diff options
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/posixmodule.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 8f32fd4..d8c81b6 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -3597,7 +3597,8 @@ posix_fork1(PyObject *self, PyObject *noargs) pid_t pid = fork1(); if (pid == -1) return posix_error(); - PyOS_AfterFork(); + if (pid == 0) + PyOS_AfterFork(); return PyInt_FromLong(pid); } #endif |