linux: fix build error with old kernel headers

O_CLOEXEC was introduced in linux 2.6.23, don't assume it's available.

Fixes #400.
This commit is contained in:
Ben Noordhuis 2012-05-02 17:41:20 +02:00
parent 19aca7a7c0
commit 1ebe14e494

View File

@ -25,7 +25,6 @@
#include <assert.h>
#include <errno.h>
#include <sys/wait.h>
#include <fcntl.h> /* O_CLOEXEC, O_NONBLOCK */
#include <poll.h>
#include <unistd.h>
#include <stdio.h>
@ -108,10 +107,10 @@ int uv__make_pipe(int fds[2], int flags) {
#if __linux__
int fl;
fl = O_CLOEXEC;
fl = UV__O_CLOEXEC;
if (flags & UV__F_NONBLOCK)
fl |= O_NONBLOCK;
fl |= UV__O_NONBLOCK;
if (uv__pipe2(fds, fl) == 0)
return 0;