Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

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.
  • Loading branch information
bnoordhuis committed May 2, 2012
1 parent 19aca7a commit 1ebe14e4942c7fb69fa5a96b0bfb58a797881828
Showing with 2 additions and 3 deletions.
  1. +2 −3 src/unix/process.c
@@ -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;

0 comments on commit 1ebe14e

Please sign in to comment.
You can’t perform that action at this time.