diff options
author | Bert Belder <bertbelder@gmail.com> | 2012-06-12 19:19:26 +0200 |
---|---|---|
committer | Bert Belder <bertbelder@gmail.com> | 2012-06-12 19:54:56 +0200 |
commit | a55faeac18f4ec2121935b52b703ba5abf2a1767 (patch) | |
tree | 2da2c46357dac9e03649f286ee00d892855ecdd5 /deps/uv/src/unix/process.c | |
parent | cbeeea62cf10bbf71636fe03282590050beb1d36 (diff) | |
download | android-node-v8-a55faeac18f4ec2121935b52b703ba5abf2a1767.tar.gz android-node-v8-a55faeac18f4ec2121935b52b703ba5abf2a1767.tar.bz2 android-node-v8-a55faeac18f4ec2121935b52b703ba5abf2a1767.zip |
uv: upgrade to b7e150ee
Diffstat (limited to 'deps/uv/src/unix/process.c')
-rw-r--r-- | deps/uv/src/unix/process.c | 29 |
1 files changed, 6 insertions, 23 deletions
diff --git a/deps/uv/src/unix/process.c b/deps/uv/src/unix/process.c index d3eb998c1b..230afe991f 100644 --- a/deps/uv/src/unix/process.c +++ b/deps/uv/src/unix/process.c @@ -68,25 +68,15 @@ static void uv__chld(EV_P_ ev_child* watcher, int revents) { int uv__make_socketpair(int fds[2], int flags) { -#ifdef SOCK_NONBLOCK - int fl; - - fl = SOCK_CLOEXEC; - - if (flags & UV__F_NONBLOCK) - fl |= SOCK_NONBLOCK; - - if (socketpair(AF_UNIX, SOCK_STREAM|fl, 0, fds) == 0) +#if __linux__ + if (socketpair(AF_UNIX, SOCK_STREAM | UV__SOCK_CLOEXEC | flags, 0, fds) == 0) return 0; + /* Retry on EINVAL, it means SOCK_CLOEXEC is not supported. + * Anything else is a genuine error. + */ if (errno != EINVAL) return -1; - - /* errno == EINVAL so maybe the kernel headers lied about - * the availability of SOCK_NONBLOCK. This can happen if people - * build libuv against newer kernel headers than the kernel - * they actually run the software on. - */ #endif if (socketpair(AF_UNIX, SOCK_STREAM, 0, fds)) @@ -106,14 +96,7 @@ int uv__make_socketpair(int fds[2], int flags) { int uv__make_pipe(int fds[2], int flags) { #if __linux__ - int fl; - - fl = UV__O_CLOEXEC; - - if (flags & UV__F_NONBLOCK) - fl |= UV__O_NONBLOCK; - - if (uv__pipe2(fds, fl) == 0) + if (uv__pipe2(fds, flags | UV__O_CLOEXEC) == 0) return 0; if (errno != ENOSYS) |