summaryrefslogtreecommitdiffstats
path: root/Modules/posixmodule.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2015-09-15 08:24:27 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2015-09-15 08:24:27 (GMT)
commit024364a89aee39e4d4f47b08ad93f262f5f97dc6 (patch)
tree6cd1cef11985af674801dc0384263b79a336e8a0 /Modules/posixmodule.c
parent13e457c80819f118a5c531ecb94304d26c803e8e (diff)
parentd3ffd32767e1b05cc54e38e2d518b9b528ff8826 (diff)
downloadcpython-024364a89aee39e4d4f47b08ad93f262f5f97dc6.zip
cpython-024364a89aee39e4d4f47b08ad93f262f5f97dc6.tar.gz
cpython-024364a89aee39e4d4f47b08ad93f262f5f97dc6.tar.bz2
Merge 3.5 (os.waitpid)
Diffstat (limited to 'Modules/posixmodule.c')
-rw-r--r--Modules/posixmodule.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index d2e2801..6654fbb 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -7021,7 +7021,7 @@ os_waitpid_impl(PyModuleDef *module, Py_intptr_t pid, int options)
res = _cwait(&status, pid, options);
Py_END_ALLOW_THREADS
} while (res < 0 && errno == EINTR && !(async_err = PyErr_CheckSignals()));
- if (res != 0)
+ if (res < 0)
return (!async_err) ? posix_error() : NULL;
/* shift the status left a byte so this is more like the POSIX waitpid */
@@ -7731,7 +7731,7 @@ os_open_impl(PyModuleDef *module, path_t *path, int flags, int mode,
} while (fd < 0 && errno == EINTR && !(async_err = PyErr_CheckSignals()));
_Py_END_SUPPRESS_IPH
- if (fd == -1) {
+ if (fd < 0) {
if (!async_err)
PyErr_SetFromErrnoWithFilenameObject(PyExc_OSError, path->object);
return -1;