]> granicus.if.org Git - python/commitdiff
select.epoll.fromfd(fd) must be not change the inheritable flag of the file
authorVictor Stinner <vstinner@wyplay.com>
Wed, 28 Aug 2013 10:22:39 +0000 (12:22 +0200)
committerVictor Stinner <vstinner@wyplay.com>
Wed, 28 Aug 2013 10:22:39 +0000 (12:22 +0200)
descriptor

Modules/selectmodule.c

index 0ff09b4bb66e3e07cfb3f832d7bf62b7492533da..22106b1dbd37845061f8813d52bcfb8031e1fd0e 100644 (file)
@@ -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;
     }