diff options
author | cjihrig <cjihrig@gmail.com> | 2019-09-09 13:08:37 -0400 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2019-09-12 00:49:02 -0700 |
commit | df0e2e3625d1f72e8b04e05ffa13997a51e9f0d7 (patch) | |
tree | 5ef978de762b47bcfc6323c48e7e22b862d6d657 /deps/uv/src/unix/core.c | |
parent | 62e8cc5e61a36ebe1bd913983a452961aa1c9946 (diff) | |
download | android-node-v8-df0e2e3625d1f72e8b04e05ffa13997a51e9f0d7.tar.gz android-node-v8-df0e2e3625d1f72e8b04e05ffa13997a51e9f0d7.tar.bz2 android-node-v8-df0e2e3625d1f72e8b04e05ffa13997a51e9f0d7.zip |
deps: upgrade to libuv 1.32.0
Notable changes:
- `uv_tcp_close_reset()` has been added.
- `uv_udp_set_source_membership()` has been added.
- A double free in `uv_free_cpu_info()` on OpenBSD
has been fixed.
- Defined, but empty environment variables can now
be read on Windows.
- Several improvements to the cmake build process.
- The `EILSEQ` error code is now mapped by libuv.
PR-URL: https://github.com/nodejs/node/pull/29508
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'deps/uv/src/unix/core.c')
-rw-r--r-- | deps/uv/src/unix/core.c | 45 |
1 files changed, 20 insertions, 25 deletions
diff --git a/deps/uv/src/unix/core.c b/deps/uv/src/unix/core.c index f4b94e30cc..366c43c2ab 100644 --- a/deps/uv/src/unix/core.c +++ b/deps/uv/src/unix/core.c @@ -30,7 +30,7 @@ #include <unistd.h> #include <sys/types.h> #include <sys/stat.h> -#include <fcntl.h> +#include <fcntl.h> /* O_CLOEXEC */ #include <sys/ioctl.h> #include <sys/socket.h> #include <sys/un.h> @@ -49,17 +49,19 @@ # include <sys/wait.h> #endif -#ifdef __APPLE__ +#if defined(__APPLE__) +# include <sys/filio.h> +# endif /* defined(__APPLE__) */ + + +#if defined(__APPLE__) && !TARGET_OS_IPHONE # include <crt_externs.h> # include <mach-o/dyld.h> /* _NSGetExecutablePath */ -# include <sys/filio.h> -# if defined(O_CLOEXEC) -# define UV__O_CLOEXEC O_CLOEXEC -# endif # define environ (*_NSGetEnviron()) -#else +#else /* defined(__APPLE__) && !TARGET_OS_IPHONE */ extern char** environ; -#endif +#endif /* !(defined(__APPLE__) && !TARGET_OS_IPHONE) */ + #if defined(__DragonFly__) || \ defined(__FreeBSD__) || \ @@ -68,7 +70,6 @@ extern char** environ; # include <sys/sysctl.h> # include <sys/filio.h> # include <sys/wait.h> -# define UV__O_CLOEXEC O_CLOEXEC # if defined(__FreeBSD__) && __FreeBSD__ >= 10 # define uv__accept4 accept4 # endif @@ -1000,24 +1001,17 @@ int uv_getrusage(uv_rusage_t* rusage) { int uv__open_cloexec(const char* path, int flags) { - int err; +#if defined(O_CLOEXEC) int fd; -#if defined(UV__O_CLOEXEC) - static int no_cloexec; - - if (!no_cloexec) { - fd = open(path, flags | UV__O_CLOEXEC); - if (fd != -1) - return fd; - - if (errno != EINVAL) - return UV__ERR(errno); + fd = open(path, flags | O_CLOEXEC); + if (fd == -1) + return UV__ERR(errno); - /* O_CLOEXEC not supported. */ - no_cloexec = 1; - } -#endif + return fd; +#else /* O_CLOEXEC */ + int err; + int fd; fd = open(path, flags); if (fd == -1) @@ -1030,6 +1024,7 @@ int uv__open_cloexec(const char* path, int flags) { } return fd; +#endif /* O_CLOEXEC */ } @@ -1051,7 +1046,7 @@ int uv__dup2_cloexec(int oldfd, int newfd) { static int no_dup3; if (!no_dup3) { do - r = uv__dup3(oldfd, newfd, UV__O_CLOEXEC); + r = uv__dup3(oldfd, newfd, O_CLOEXEC); while (r == -1 && errno == EBUSY); if (r != -1) return r; |