diff options
author | Bert Belder <bertbelder@gmail.com> | 2012-06-12 17:05:49 +0200 |
---|---|---|
committer | Bert Belder <bertbelder@gmail.com> | 2012-06-12 17:06:54 +0200 |
commit | b615077bab71db73cf065d6162cae8d6cb84d8d2 (patch) | |
tree | 340f343986de77b62cc9cd4d1cb7694adb9e9c38 /deps/uv/src/unix/process.c | |
parent | 0385b17ce06b7c12ad3e4035477f6a0cf897580e (diff) | |
download | android-node-v8-b615077bab71db73cf065d6162cae8d6cb84d8d2.tar.gz android-node-v8-b615077bab71db73cf065d6162cae8d6cb84d8d2.tar.bz2 android-node-v8-b615077bab71db73cf065d6162cae8d6cb84d8d2.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) |