diff options
author | Gregory P. Smith <greg@mad-scientist.com> | 2010-03-01 17:04:45 (GMT) |
---|---|---|
committer | Gregory P. Smith <greg@mad-scientist.com> | 2010-03-01 17:04:45 (GMT) |
commit | 2a1c0275444bcc1bfd0001e58526530b5138efe4 (patch) | |
tree | e93382c8b014aa272a000efbb8c6608291f268ca /Modules/posixmodule.c | |
parent | 24cec9fe07a1f7e408a0ff846c6491e0cf8295c4 (diff) | |
download | cpython-2a1c0275444bcc1bfd0001e58526530b5138efe4.zip cpython-2a1c0275444bcc1bfd0001e58526530b5138efe4.tar.gz cpython-2a1c0275444bcc1bfd0001e58526530b5138efe4.tar.bz2 |
Merged revisions 78531 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r78531 | gregory.p.smith | 2010-02-28 18:31:33 -0800 (Sun, 28 Feb 2010) | 2 lines
Fix for r78527. It left out updating forkpty.
........
Diffstat (limited to 'Modules/posixmodule.c')
-rw-r--r-- | Modules/posixmodule.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 202fae5..abe6189 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -3880,15 +3880,18 @@ To both, return fd of newly opened pseudo-terminal.\n"); static PyObject * posix_forkpty(PyObject *self, PyObject *noargs) { - int master_fd = -1, result; + int master_fd = -1, result = 0; pid_t pid; _PyImport_AcquireLock(); pid = forkpty(&master_fd, NULL, NULL, NULL); - if (pid == 0) + if (pid == 0) { + /* child: this clobbers and resets the import lock. */ PyOS_AfterFork(); - - result = _PyImport_ReleaseLock(); + } else { + /* parent: release the import lock. */ + result = _PyImport_ReleaseLock(); + } if (pid == -1) return posix_error(); if (result < 0) { |