From: Victor Stinner Date: Wed, 28 Aug 2013 10:22:39 +0000 (+0200) Subject: select.epoll.fromfd(fd) must be not change the inheritable flag of the file X-Git-Tag: v3.4.0a2~94 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d72fe89b800cf8ce66b742c16e93345361976ee6;p=python select.epoll.fromfd(fd) must be not change the inheritable flag of the file descriptor --- diff --git a/Modules/selectmodule.c b/Modules/selectmodule.c index 0ff09b4bb6..22106b1dbd 100644 --- a/Modules/selectmodule.c +++ b/Modules/selectmodule.c @@ -1212,7 +1212,7 @@ newPyEpoll_Object(PyTypeObject *type, int sizehint, int flags, SOCKET fd) } #ifndef HAVE_EPOLL_CREATE1 - if (_Py_set_inheritable(self->epfd, 0, NULL) < 0) { + if (fd == -1 && _Py_set_inheritable(self->epfd, 0, NULL) < 0) { Py_DECREF(self); return NULL; }