mirror of
https://github.com/python/cpython.git
synced 2025-11-02 03:01:58 +00:00
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. ........
This commit is contained in:
parent
24cec9fe07
commit
2a1c027544
1 changed files with 7 additions and 4 deletions
|
|
@ -3880,15 +3880,18 @@ To both, return fd of newly opened pseudo-terminal.\n");
|
||||||
static PyObject *
|
static PyObject *
|
||||||
posix_forkpty(PyObject *self, PyObject *noargs)
|
posix_forkpty(PyObject *self, PyObject *noargs)
|
||||||
{
|
{
|
||||||
int master_fd = -1, result;
|
int master_fd = -1, result = 0;
|
||||||
pid_t pid;
|
pid_t pid;
|
||||||
|
|
||||||
_PyImport_AcquireLock();
|
_PyImport_AcquireLock();
|
||||||
pid = forkpty(&master_fd, NULL, NULL, NULL);
|
pid = forkpty(&master_fd, NULL, NULL, NULL);
|
||||||
if (pid == 0)
|
if (pid == 0) {
|
||||||
|
/* child: this clobbers and resets the import lock. */
|
||||||
PyOS_AfterFork();
|
PyOS_AfterFork();
|
||||||
|
} else {
|
||||||
result = _PyImport_ReleaseLock();
|
/* parent: release the import lock. */
|
||||||
|
result = _PyImport_ReleaseLock();
|
||||||
|
}
|
||||||
if (pid == -1)
|
if (pid == -1)
|
||||||
return posix_error();
|
return posix_error();
|
||||||
if (result < 0) {
|
if (result < 0) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue