Skip to content
This repository has been archived by the owner on May 4, 2018. It is now read-only.

Commit

Permalink
linux: fix build error with old kernel headers
Browse files Browse the repository at this point in the history
O_CLOEXEC was introduced in linux 2.6.23, don't assume it's available.

Fixes #400.
  • Loading branch information
bnoordhuis committed May 2, 2012
1 parent 19aca7a commit 1ebe14e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/unix/process.c
Expand Up @@ -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>
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 1ebe14e

Please sign in to comment.