mirror of
https://github.com/python/cpython.git
synced 2025-11-26 21:33:10 +00:00
Fix posix.fork1() / os.fork1() to only call PyOS_AfterFork() in the child
process rather than both parent and child. Does anyone actually use fork1()? It appears to be a Solaris thing but if Python is built with pthreads on Solaris, fork1() and fork() should be the same.
This commit is contained in:
parent
4ec0c27eea
commit
fb7a50fbb9
1 changed files with 2 additions and 1 deletions
|
|
@ -3597,7 +3597,8 @@ posix_fork1(PyObject *self, PyObject *noargs)
|
||||||
pid_t pid = fork1();
|
pid_t pid = fork1();
|
||||||
if (pid == -1)
|
if (pid == -1)
|
||||||
return posix_error();
|
return posix_error();
|
||||||
PyOS_AfterFork();
|
if (pid == 0)
|
||||||
|
PyOS_AfterFork();
|
||||||
return PyInt_FromLong(pid);
|
return PyInt_FromLong(pid);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue