summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXavier de Gaye <xdegaye@users.sourceforge.net>2016-11-19 15:19:29 (GMT)
committerXavier de Gaye <xdegaye@users.sourceforge.net>2016-11-19 15:19:29 (GMT)
commitec5d3cd533be223248a77a881f584e64f4777646 (patch)
treecd38bddc404c4154880fd84b192be3cc5e135366
parent78ffd6cffacb04bea61bb0ef850d05859ab2dbe4 (diff)
downloadcpython-ec5d3cd533be223248a77a881f584e64f4777646.zip
cpython-ec5d3cd533be223248a77a881f584e64f4777646.tar.gz
cpython-ec5d3cd533be223248a77a881f584e64f4777646.tar.bz2
Issue #28746: Fix the set_inheritable() file descriptor method on platforms
that do not have the ioctl FIOCLEX and FIONCLEX commands
-rw-r--r--Misc/NEWS3
-rw-r--r--Python/fileutils.c2
2 files changed, 4 insertions, 1 deletions
diff --git a/Misc/NEWS b/Misc/NEWS
index 558366f..afee56a 100644
--- 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.
diff --git a/Python/fileutils.c b/Python/fileutils.c
index e3bfb0c..6a32c42 100644
--- a/Python/fileutils.c
+++ b/Python/fileutils.c
@@ -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);