From c54f4bc8e847f7b5a48e425568ca8f5549c72c48 Mon Sep 17 00:00:00 2001 From: cjihrig Date: Mon, 7 May 2018 18:36:08 -0400 Subject: [PATCH] deps: upgrade to libuv 1.20.3 Backport-PR-URL: https://github.com/nodejs/node/pull/24103 Refs: https://github.com/nodejs/node/pull/19377 PR-URL: https://github.com/nodejs/node/pull/20585 Reviewed-By: Ben Noordhuis Reviewed-By: James M Snell --- deps/uv/AUTHORS | 1 + deps/uv/ChangeLog | 19 +++++++++++++++++++ deps/uv/README.md | 7 +++++++ deps/uv/configure.ac | 2 +- deps/uv/include/uv-version.h | 2 +- deps/uv/m4/libuv-check-flags.m4 | 4 ++-- deps/uv/src/unix/internal.h | 12 ++++++++++++ deps/uv/src/unix/os390-syscalls.c | 2 ++ deps/uv/src/win/getaddrinfo.c | 10 ++++++++-- deps/uv/src/win/pipe.c | 7 +++++++ deps/uv/src/win/util.c | 2 +- deps/uv/src/win/winapi.c | 11 +++++++++++ deps/uv/src/win/winapi.h | 15 +++++++++++++++ 13 files changed, 87 insertions(+), 7 deletions(-) diff --git a/deps/uv/AUTHORS b/deps/uv/AUTHORS index ba360e3f74e277..b605a0f3bc1544 100644 --- a/deps/uv/AUTHORS +++ b/deps/uv/AUTHORS @@ -337,3 +337,4 @@ Thomas Versteeg zzzjim Alex Arslan Kyle Farnung +ssrlive <30760636+ssrlive@users.noreply.github.com> diff --git a/deps/uv/ChangeLog b/deps/uv/ChangeLog index a7cd0ad2dc5003..0ec1488412d630 100644 --- a/deps/uv/ChangeLog +++ b/deps/uv/ChangeLog @@ -1,3 +1,22 @@ +2018.05.08, Version 1.20.3 (Stable), 8cfd67e59195251dff793ee47c185c9d6a8f3818 + +Changes since version 1.20.2: + +* win: add Windows XP support to uv_if_indextoname() (ssrlive) + +* win: fix `'floor' undefined` compiler warning (ssrlive) + +* win, pipe: stop read for overlapped pipe (Bartosz Sosnowski) + +* build: fix utf-8 name of copyright holder (Jérémy Lal) + +* zos: initialize pollfd revents (jBarz) + +* zos,doc: add system V message queue note (jBarz) + +* linux: don't use uv__nonblock_ioctl() on sparc (Ben Noordhuis) + + 2018.04.23, Version 1.20.2 (Stable), c51fd3f66bbb386a1efdeba6812789f35a372d1e Changes since version 1.20.1: diff --git a/deps/uv/README.md b/deps/uv/README.md index 1aaed1a88e7f10..d42ada56a8267e 100644 --- a/deps/uv/README.md +++ b/deps/uv/README.md @@ -322,6 +322,13 @@ describes the package in more detail. AIX support for filesystem events is not compiled when building with `gyp`. +### z/OS Notes + +z/OS creates System V semaphores and message queues. These persist on the system +after the process terminates unless the event loop is closed. + +Use the `ipcrm` command to manually clear up System V resources. + ## Patches See the [guidelines for contributing][]. diff --git a/deps/uv/configure.ac b/deps/uv/configure.ac index f4d97daaba0cb9..5178c60ba1938e 100644 --- a/deps/uv/configure.ac +++ b/deps/uv/configure.ac @@ -13,7 +13,7 @@ # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. AC_PREREQ(2.57) -AC_INIT([libuv], [1.20.2], [https://github.com/libuv/libuv/issues]) +AC_INIT([libuv], [1.20.3], [https://github.com/libuv/libuv/issues]) AC_CONFIG_MACRO_DIR([m4]) m4_include([m4/libuv-extra-automake-flags.m4]) m4_include([m4/as_case.m4]) diff --git a/deps/uv/include/uv-version.h b/deps/uv/include/uv-version.h index 18f40da890bcb9..75f2940cd46b3e 100644 --- a/deps/uv/include/uv-version.h +++ b/deps/uv/include/uv-version.h @@ -32,7 +32,7 @@ #define UV_VERSION_MAJOR 1 #define UV_VERSION_MINOR 20 -#define UV_VERSION_PATCH 2 +#define UV_VERSION_PATCH 3 #define UV_VERSION_IS_RELEASE 1 #define UV_VERSION_SUFFIX "" diff --git a/deps/uv/m4/libuv-check-flags.m4 b/deps/uv/m4/libuv-check-flags.m4 index 59c30635577d1a..e347056ae2ef2c 100644 --- a/deps/uv/m4/libuv-check-flags.m4 +++ b/deps/uv/m4/libuv-check-flags.m4 @@ -1,5 +1,5 @@ dnl Macros to check the presence of generic (non-typed) symbols. -dnl Copyright (c) 2006-2008 Diego Pettenà +dnl Copyright (c) 2006-2008 Diego Pettenò dnl Copyright (c) 2006-2008 xine project dnl dnl This program is free software; you can redistribute it and/or modify @@ -316,4 +316,4 @@ AC_DEFUN([CC_ATTRIBUTE_ALIGNED], [ AC_DEFINE_UNQUOTED([ATTRIBUTE_ALIGNED_MAX], [$cc_cv_attribute_aligned], [Define the highest alignment supported]) fi -]) \ No newline at end of file +]) diff --git a/deps/uv/src/unix/internal.h b/deps/uv/src/unix/internal.h index b6df1ab9d3e52d..63e478fd98124b 100644 --- a/deps/uv/src/unix/internal.h +++ b/deps/uv/src/unix/internal.h @@ -185,6 +185,18 @@ struct uv__stream_queued_fds_s { #define uv__nonblock uv__nonblock_fcntl #endif +/* On Linux, uv__nonblock_fcntl() and uv__nonblock_ioctl() do not commute + * when O_NDELAY is not equal to O_NONBLOCK. Case in point: linux/sparc32 + * and linux/sparc64, where O_NDELAY is O_NONBLOCK + another bit. + * + * Libuv uses uv__nonblock_fcntl() directly sometimes so ensure that it + * commutes with uv__nonblock(). + */ +#if defined(__linux__) && O_NDELAY != O_NONBLOCK +#undef uv__nonblock +#define uv__nonblock uv__nonblock_fcntl +#endif + /* core */ int uv__cloexec_ioctl(int fd, int set); int uv__cloexec_fcntl(int fd, int set); diff --git a/deps/uv/src/unix/os390-syscalls.c b/deps/uv/src/unix/os390-syscalls.c index 21558ea8689a00..a5dd34426de969 100644 --- a/deps/uv/src/unix/os390-syscalls.c +++ b/deps/uv/src/unix/os390-syscalls.c @@ -215,6 +215,7 @@ uv__os390_epoll* epoll_create1(int flags) { maybe_resize(lst, 1); lst->items[lst->size - 1].fd = lst->msg_queue; lst->items[lst->size - 1].events = POLLIN; + lst->items[lst->size - 1].revents = 0; uv_once(&once, epoll_init); uv_mutex_lock(&global_epoll_lock); QUEUE_INSERT_TAIL(&global_epoll_queue, &lst->member); @@ -252,6 +253,7 @@ int epoll_ctl(uv__os390_epoll* lst, } lst->items[fd].fd = fd; lst->items[fd].events = event->events; + lst->items[fd].revents = 0; } else if (op == EPOLL_CTL_MOD) { if (fd >= lst->size || lst->items[fd].fd == -1) { uv_mutex_unlock(&global_epoll_lock); diff --git a/deps/uv/src/win/getaddrinfo.c b/deps/uv/src/win/getaddrinfo.c index 282d919cf75513..5adc7663bd6b68 100644 --- a/deps/uv/src/win/getaddrinfo.c +++ b/deps/uv/src/win/getaddrinfo.c @@ -392,15 +392,21 @@ int uv_if_indextoname(unsigned int ifindex, char* buffer, size_t* size) { DWORD bufsize; int r; + uv__once_init(); + if (buffer == NULL || size == NULL || *size == 0) return UV_EINVAL; - r = ConvertInterfaceIndexToLuid(ifindex, &luid); + if (pConvertInterfaceIndexToLuid == NULL) + return UV_ENOSYS; + r = pConvertInterfaceIndexToLuid(ifindex, &luid); if (r != 0) return uv_translate_sys_error(r); - r = ConvertInterfaceLuidToNameW(&luid, wname, ARRAY_SIZE(wname)); + if (pConvertInterfaceLuidToNameW == NULL) + return UV_ENOSYS; + r = pConvertInterfaceLuidToNameW(&luid, wname, ARRAY_SIZE(wname)); if (r != 0) return uv_translate_sys_error(r); diff --git a/deps/uv/src/win/pipe.c b/deps/uv/src/win/pipe.c index 0ecfbf1f0e5145..83ee4f99ca363d 100644 --- a/deps/uv/src/win/pipe.c +++ b/deps/uv/src/win/pipe.c @@ -735,6 +735,13 @@ void uv__pipe_unpause_read(uv_pipe_t* handle) { void uv__pipe_stop_read(uv_pipe_t* handle) { + if (pCancelIoEx && + !(handle->flags & UV_HANDLE_NON_OVERLAPPED_PIPE) && + !(handle->flags & UV_HANDLE_EMULATE_IOCP) && + handle->flags & UV_HANDLE_READING && + handle->read_req.type == UV_READ) { + pCancelIoEx(handle->handle, &handle->read_req.u.io.overlapped); + } handle->flags &= ~UV_HANDLE_READING; uv__pipe_pause_read((uv_pipe_t*)handle); uv__pipe_unpause_read((uv_pipe_t*)handle); diff --git a/deps/uv/src/win/util.c b/deps/uv/src/win/util.c index 5d1c812dd75b2c..49b5bc72061c30 100644 --- a/deps/uv/src/win/util.c +++ b/deps/uv/src/win/util.c @@ -37,7 +37,7 @@ #include #include #include - +#include /* * Max title length; the only thing MSDN tells us about the maximum length diff --git a/deps/uv/src/win/winapi.c b/deps/uv/src/win/winapi.c index 4ccdf0a5f97ca2..c3307861427884 100644 --- a/deps/uv/src/win/winapi.c +++ b/deps/uv/src/win/winapi.c @@ -55,12 +55,16 @@ sPowerRegisterSuspendResumeNotification pPowerRegisterSuspendResumeNotification; /* User32.dll function pointer */ sSetWinEventHook pSetWinEventHook; +/* iphlpapi.dll function pointer */ +sConvertInterfaceIndexToLuid pConvertInterfaceIndexToLuid = NULL; +sConvertInterfaceLuidToNameW pConvertInterfaceLuidToNameW = NULL; void uv_winapi_init(void) { HMODULE ntdll_module; HMODULE kernel32_module; HMODULE powrprof_module; HMODULE user32_module; + HMODULE iphlpapi_module; ntdll_module = GetModuleHandleA("ntdll.dll"); if (ntdll_module == NULL) { @@ -166,4 +170,11 @@ void uv_winapi_init(void) { GetProcAddress(user32_module, "SetWinEventHook"); } + iphlpapi_module = LoadLibraryA("iphlpapi.dll"); + if (iphlpapi_module != NULL) { + pConvertInterfaceIndexToLuid = (sConvertInterfaceIndexToLuid) + GetProcAddress(iphlpapi_module, "ConvertInterfaceIndexToLuid"); + pConvertInterfaceLuidToNameW = (sConvertInterfaceLuidToNameW) + GetProcAddress(iphlpapi_module, "ConvertInterfaceLuidToNameW"); + } } diff --git a/deps/uv/src/win/winapi.h b/deps/uv/src/win/winapi.h index cc54b79b08dd19..38570c2ffa7598 100644 --- a/deps/uv/src/win/winapi.h +++ b/deps/uv/src/win/winapi.h @@ -4775,4 +4775,19 @@ extern sPowerRegisterSuspendResumeNotification pPowerRegisterSuspendResumeNotifi /* User32.dll function pointer */ extern sSetWinEventHook pSetWinEventHook; +/* iphlpapi.dll function pointer */ +union _NET_LUID_LH; +typedef DWORD (WINAPI *sConvertInterfaceIndexToLuid)( + ULONG InterfaceIndex, + union _NET_LUID_LH *InterfaceLuid); + +typedef DWORD (WINAPI *sConvertInterfaceLuidToNameW)( + const union _NET_LUID_LH *InterfaceLuid, + PWSTR InterfaceName, + size_t Length); + +extern sConvertInterfaceIndexToLuid pConvertInterfaceIndexToLuid; +extern sConvertInterfaceLuidToNameW pConvertInterfaceLuidToNameW; + + #endif /* UV_WIN_WINAPI_H_ */