[Python-checkins] cpython: select.epoll.fromfd(fd) must be not change the inheritable flag of the file

victor.stinner python-checkins at python.org
Wed Aug 28 12:44:46 CEST 2013


http://hg.python.org/cpython/rev/b4bc10514174
changeset:   85430:b4bc10514174
user:        Victor Stinner <vstinner at wyplay.com>
date:        Wed Aug 28 12:22:39 2013 +0200
summary:
  select.epoll.fromfd(fd) must be not change the inheritable flag of the file
descriptor

files:
  Modules/selectmodule.c |  2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)


diff --git a/Modules/selectmodule.c b/Modules/selectmodule.c
--- a/Modules/selectmodule.c
+++ b/Modules/selectmodule.c
@@ -1212,7 +1212,7 @@
     }
 
 #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;
     }

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list