cpython: 801634d3c105 (original) (raw)
Mercurial > cpython
changeset 103401:801634d3c105
Issue #27781: Fixes uninitialized fd when !MS_WINDOWS and !HAVE_OPENAT [#27781]
Steve Dower steve.dower@microsoft.com | |
---|---|
date | Fri, 09 Sep 2016 09:03:15 -0700 |
parents | 4e80a157ea66 |
children | 35447332ab19 |
files | Modules/posixmodule.c |
diffstat | 1 files changed, 3 insertions(+), 2 deletions(-)[+] [-] Modules/posixmodule.c 5 |
line wrap: on
line diff
--- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -7477,13 +7477,14 @@ os_open_impl(PyObject *module, path_t p Py_BEGIN_ALLOW_THREADS #ifdef MS_WINDOWS fd = _wopen(path->wide, flags, mode); -#endif +#else #ifdef HAVE_OPENAT if (dir_fd != DEFAULT_DIR_FD) fd = openat(dir_fd, path->narrow, flags, mode); else +#endif / HAVE_OPENAT / fd = open(path->narrow, flags, mode); -#endif +#endif / !MS_WINDOWS */ Py_END_ALLOW_THREADS } while (fd < 0 && errno == EINTR && !(async_err = PyErr_CheckSignals())); _Py_END_SUPPRESS_IPH