summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2015-09-15 08:11:03 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2015-09-15 08:11:03 (GMT)
commitd3ffd32767e1b05cc54e38e2d518b9b528ff8826 (patch)
tree699c732bc5a18642b559561a40fc298da1cd58d6 /Modules
parentd64cfc215c74c5ba1c97f23fde9291c2d50dc3a9 (diff)
downloadcpython-d3ffd32767e1b05cc54e38e2d518b9b528ff8826.zip
cpython-d3ffd32767e1b05cc54e38e2d518b9b528ff8826.tar.gz
cpython-d3ffd32767e1b05cc54e38e2d518b9b528ff8826.tar.bz2
Issue #25118: Fix a regression of Python 3.5.0 in os.waitpid() on Windows.
Add an unit test on os.waitpid()
Diffstat (limited to 'Modules')
-rw-r--r--Modules/posixmodule.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index c0baf6a..854a749 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;