Skip to content
This repository has been archived by the owner on Oct 27, 2022. It is now read-only.

Commit

Permalink
Add missing check for O_CLOEXEC being defined
Browse files Browse the repository at this point in the history
This should address issue #12 compiling on ancient Linux distros.
  • Loading branch information
gpshead committed Aug 8, 2016
1 parent 78b5214 commit eae9e95
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions _posixsubprocess.c
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,7 @@ subprocess_cloexec_pipe(PyObject *self, PyObject *noargs)
int fds[2];
int res, saved_errno;
long oldflags;
#ifdef HAVE_PIPE2
#if (defined(HAVE_PIPE2) && defined(O_CLOEXEC))
Py_BEGIN_ALLOW_THREADS
res = pipe2(fds, O_CLOEXEC);
Py_END_ALLOW_THREADS
Expand All @@ -784,7 +784,7 @@ subprocess_cloexec_pipe(PyObject *self, PyObject *noargs)
}
if (res == 0)
res = fcntl(fds[1], F_SETFD, oldflags | FD_CLOEXEC);
#ifdef HAVE_PIPE2
#if (defined(HAVE_PIPE2) && defined(O_CLOEXEC))
}
#endif
if (res == 0 && fds[1] < 3) {
Expand Down

0 comments on commit eae9e95

Please sign in to comment.