]> granicus.if.org Git - python/commitdiff
Issue #28746: Fix the set_inheritable() file descriptor method on platforms
authorXavier de Gaye <xdegaye@users.sourceforge.net>
Sat, 19 Nov 2016 15:19:29 +0000 (16:19 +0100)
committerXavier de Gaye <xdegaye@users.sourceforge.net>
Sat, 19 Nov 2016 15:19:29 +0000 (16:19 +0100)
that do not have the ioctl FIOCLEX and FIONCLEX commands

Misc/NEWS
Python/fileutils.c

index 558366f4a611b0fda2da4bc505f3beb067b2e95a..afee56ae48cd6f78a8bfa4074b7bb4abb93fc700 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -10,6 +10,9 @@ What's New in Python 3.6.0 beta 4
 Core and Builtins
 -----------------
 
+- Issue #28746: Fix the set_inheritable() file descriptor method on platforms
+  that do not have the ioctl FIOCLEX and FIONCLEX commands.
+
 - Issue #26920: Fix not getting the locale's charset upon initializing the
   interpreter, on platforms that do not have langinfo.
 
index e3bfb0c502a2d76c1c5b91f05d4d9f68355903d1..6a32c42c80ad853716c3cc9e1a16d8155022d564 100644 (file)
@@ -886,7 +886,7 @@ set_inheritable(int fd, int inheritable, int raise, int *atomic_flag_works)
         return 0;
     }
 
-    res = fcntl(fd, F_SETFD, flags);
+    res = fcntl(fd, F_SETFD, new_flags);
     if (res < 0) {
         if (raise)
             PyErr_SetFromErrno(PyExc_OSError);