diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2015-09-15 10:11:03 +0200 |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2015-09-15 10:11:03 +0200 |
commit | 4f15b0bd3b6aee9f9635459e23dca1fc8a172988 (patch) | |
tree | f47a93a1dc00302ff21b0c079a13a9e721135d43 /Modules | |
parent | 458032a249e61213cfd53f3e27dcc16003310812 (diff) | |
download | cpython-4f15b0bd3b6aee9f9635459e23dca1fc8a172988.tar.gz |
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.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index c0baf6ac69..854a7491c5 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; |