Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
In ``os.dup2``, don't check every call whether the ``dup3`` syscall exists
or not.
2 changes: 1 addition & 1 deletion Modules/posixmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -7704,7 +7704,7 @@ os_dup2_impl(PyObject *module, int fd, int fd2, int inheritable)
#if defined(HAVE_DUP3) && \
!(defined(HAVE_FCNTL_H) && defined(F_DUP2FD_CLOEXEC))
/* dup3() is available on Linux 2.6.27+ and glibc 2.9 */
int dup3_works = -1;
static int dup3_works = -1;
#endif

if (fd < 0 || fd2 < 0)
Expand Down