Skip to content

Commit 445794e

Browse files
cjihrigitaloacasas
authored andcommitted
deps: upgrade libuv to 1.11.0
Fixes: #10165 Fixes: #9856 Fixes: #10607 Fixes: #11104 PR-URL: #11094 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]> Reviewed-By: Santiago Gimeno <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
1 parent 540dca1 commit 445794e

38 files changed

+1589
-198
lines changed

deps/uv/.mailmap

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
22
33
4+
45
56
Bert Belder <[email protected]> <user@ChrUbuntu.(none)>
67

deps/uv/AUTHORS

+5
Original file line numberDiff line numberDiff line change
@@ -279,3 +279,8 @@ Philippe Laferriere <[email protected]>
279279
Will Speak <[email protected]>
280280
Hitesh Kanwathirtha <[email protected]>
281281
Eric Sciple <[email protected]>
282+
283+
284+
Daniel Bevenius <[email protected]>
285+
Howard Hellyer <[email protected]>
286+
Chris Araman <[email protected]>

deps/uv/ChangeLog

+39
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,42 @@
1+
2017.02.02, Version 1.11.0 (Stable), 7452ef4e06a4f99ee26b694c65476401534f2725
2+
3+
Changes since version 1.10.2:
4+
5+
* Now working on version 1.10.3 (cjihrig)
6+
7+
* win: added fcntl.h to uv-win.h (Michele Caini)
8+
9+
* unix: move function call out of assert (jBarz)
10+
11+
* fs: cleanup uv__fs_scandir (Santiago Gimeno)
12+
13+
* fs: fix crash in uv_fs_scandir_next (muflub)
14+
15+
* win,signal: fix potential deadlock (Bartosz Sosnowski)
16+
17+
* unix: use async-signal safe functions between fork and exec (jBarz)
18+
19+
* sunos: fix SUNOS_NO_IFADDRS build (Ben Noordhuis)
20+
21+
* zos: make platform functional (John Barboza)
22+
23+
* doc: add repitition qualifier to version regexs (Daniel Bevenius)
24+
25+
* zos: use gyp OS label "os390" on z/OS (John Barboza)
26+
27+
* aix: enable uv_get/set_process_title (Howard Hellyer)
28+
29+
* zos: use built-in proctitle implementation (John Barboza)
30+
31+
* Revert "darwin: use clock_gettime in macOS 10.12" (Chris Araman)
32+
33+
* win,test: don't write uninitialized buffer to tty (Bert Belder)
34+
35+
* win: define ERROR_ELEVATION_REQUIRED for MinGW (Richard Lau)
36+
37+
* aix: re-enable fs watch facility (Gireesh Punathil)
38+
39+
140
2017.01.10, Version 1.10.2 (Stable), cb9f579a454b8db592030ffa274ae58df78dbe20
241

342
Changes since version 1.10.1:

deps/uv/Makefile.am

+9-3
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,11 @@ test_run_tests_CFLAGS += -D_UNIX03_THREADS \
316316
endif
317317

318318
if AIX
319-
libuv_la_CFLAGS += -D_ALL_SOURCE -D_XOPEN_SOURCE=500 -D_LINUX_SOURCE_COMPAT -D_THREAD_SAFE
319+
libuv_la_CFLAGS += -D_ALL_SOURCE \
320+
-D_XOPEN_SOURCE=500 \
321+
-D_LINUX_SOURCE_COMPAT \
322+
-D_THREAD_SAFE \
323+
-DHAVE_SYS_AHAFS_EVPRODS_H
320324
include_HEADERS += include/uv-aix.h
321325
libuv_la_SOURCES += src/unix/aix.c
322326
endif
@@ -402,8 +406,10 @@ libuv_la_CFLAGS += -D_UNIX03_THREADS \
402406
-qFLOAT=IEEE
403407
libuv_la_LDFLAGS += -qXPLINK
404408
libuv_la_SOURCES += src/unix/pthread-fixes.c \
405-
src/unix/pthread-barrier.c
406-
libuv_la_SOURCES += src/unix/os390.c
409+
src/unix/pthread-barrier.c \
410+
src/unix/os390.c \
411+
src/unix/os390-syscalls.c \
412+
src/unix/proctitle.c
407413
endif
408414

409415
if HAVE_PKG_CONFIG

deps/uv/appveyor.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: v1.10.2.build{build}
1+
version: v1.11.0.build{build}
22

33
install:
44
- cinst -y nsis

deps/uv/common.gypi

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
'OTHER_CFLAGS': [ '-Wno-strict-aliasing' ],
3636
},
3737
'conditions': [
38-
['OS != "zos"', {
38+
['OS != "os390"', {
3939
'cflags': [ '-O0', '-fwrapv' ]
4040
}],
4141
['OS == "android"', {
@@ -154,7 +154,7 @@
154154
'cflags': [ '-pthreads' ],
155155
'ldflags': [ '-pthreads' ],
156156
}],
157-
[ 'OS not in "solaris android zos"', {
157+
[ 'OS not in "solaris android os390"', {
158158
'cflags': [ '-pthread' ],
159159
'ldflags': [ '-pthread' ],
160160
}],

deps/uv/configure.ac

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1414

1515
AC_PREREQ(2.57)
16-
AC_INIT([libuv], [1.10.2], [https://github.com/libuv/libuv/issues])
16+
AC_INIT([libuv], [1.11.0], [https://github.com/libuv/libuv/issues])
1717
AC_CONFIG_MACRO_DIR([m4])
1818
m4_include([m4/libuv-extra-automake-flags.m4])
1919
m4_include([m4/as_case.m4])

deps/uv/docs/src/conf.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ def get_libuv_version():
2121
with open('../../include/uv-version.h') as f:
2222
data = f.read()
2323
try:
24-
m = re.search(r"""^#define UV_VERSION_MAJOR (\d)$""", data, re.MULTILINE)
24+
m = re.search(r"""^#define UV_VERSION_MAJOR (\d+)$""", data, re.MULTILINE)
2525
major = int(m.group(1))
26-
m = re.search(r"""^#define UV_VERSION_MINOR (\d)$""", data, re.MULTILINE)
26+
m = re.search(r"""^#define UV_VERSION_MINOR (\d+)$""", data, re.MULTILINE)
2727
minor = int(m.group(1))
28-
m = re.search(r"""^#define UV_VERSION_PATCH (\d)$""", data, re.MULTILINE)
28+
m = re.search(r"""^#define UV_VERSION_PATCH (\d+)$""", data, re.MULTILINE)
2929
patch = int(m.group(1))
3030
m = re.search(r"""^#define UV_VERSION_IS_RELEASE (\d)$""", data, re.MULTILINE)
3131
is_release = int(m.group(1))

deps/uv/docs/src/misc.rst

+5-1
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,11 @@ API
192192
193193
.. c:function:: int uv_set_process_title(const char* title)
194194
195-
Sets the current process title.
195+
Sets the current process title. On platforms with a fixed size buffer for the
196+
process title the contents of `title` will be copied to the buffer and
197+
truncated if larger than the available space. Other platforms will return
198+
`UV_ENOMEM` if they cannot allocate enough space to duplicate the contents of
199+
`title`.
196200
197201
.. c:function:: int uv_resident_set_memory(size_t* rss)
198202

deps/uv/include/pthread-barrier.h

+2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1818
#define _UV_PTHREAD_BARRIER_
1919
#include <errno.h>
2020
#include <pthread.h>
21+
#if !defined(__MVS__)
2122
#include <semaphore.h> /* sem_t */
23+
#endif
2224

2325
#define PTHREAD_BARRIER_SERIAL_THREAD 0x12345
2426

deps/uv/include/uv-os390.h

+3
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,7 @@
2424

2525
#define UV_PLATFORM_SEM_T int
2626

27+
#define UV_PLATFORM_LOOP_FIELDS \
28+
void* ep; \
29+
2730
#endif /* UV_MVS_H */

deps/uv/include/uv-unix.h

+4
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,18 @@
3636
#include <termios.h>
3737
#include <pwd.h>
3838

39+
#if !defined(__MVS__)
3940
#include <semaphore.h>
41+
#endif
4042
#include <pthread.h>
4143
#include <signal.h>
4244

4345
#include "uv-threadpool.h"
4446

4547
#if defined(__linux__)
4648
# include "uv-linux.h"
49+
#elif defined (__MVS__)
50+
# include "uv-os390.h"
4751
#elif defined(_AIX)
4852
# include "uv-aix.h"
4953
#elif defined(__sun)

deps/uv/include/uv-version.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
*/
3232

3333
#define UV_VERSION_MAJOR 1
34-
#define UV_VERSION_MINOR 10
35-
#define UV_VERSION_PATCH 2
34+
#define UV_VERSION_MINOR 11
35+
#define UV_VERSION_PATCH 0
3636
#define UV_VERSION_IS_RELEASE 1
3737
#define UV_VERSION_SUFFIX ""
3838

deps/uv/include/uv-win.h

+1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ typedef struct pollfd {
4949

5050
#include <process.h>
5151
#include <signal.h>
52+
#include <fcntl.h>
5253
#include <sys/stat.h>
5354

5455
#if defined(_MSC_VER) && _MSC_VER < 1600

deps/uv/src/unix/aix.c

+84-2
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,11 @@
6464
#define RDWR_BUF_SIZE 4096
6565
#define EQ(a,b) (strcmp(a,b) == 0)
6666

67+
static void* args_mem = NULL;
68+
static char** process_argv = NULL;
69+
static int process_argc = 0;
70+
static char* process_title_ptr = NULL;
71+
6772
int uv__platform_loop_init(uv_loop_t* loop) {
6873
loop->fs_fd = -1;
6974

@@ -753,6 +758,13 @@ static void uv__ahafs_event(uv_loop_t* loop, uv__io_t* event_watch, unsigned int
753758

754759
assert((bytes >= 0) && "uv__ahafs_event - Error reading monitor file");
755760

761+
/* In file / directory move cases, AIX Event infrastructure
762+
* produces a second event with no data.
763+
* Ignore it and return gracefully.
764+
*/
765+
if(bytes == 0)
766+
return;
767+
756768
/* Parse the data */
757769
if(bytes > 0)
758770
rc = uv__parse_data(result_data, &events, handle);
@@ -881,24 +893,94 @@ void uv__fs_event_close(uv_fs_event_t* handle) {
881893

882894

883895
char** uv_setup_args(int argc, char** argv) {
884-
return argv;
896+
char** new_argv;
897+
size_t size;
898+
char* s;
899+
int i;
900+
901+
if (argc <= 0)
902+
return argv;
903+
904+
/* Save the original pointer to argv.
905+
* AIX uses argv to read the process name.
906+
* (Not the memory pointed to by argv[0..n] as on Linux.)
907+
*/
908+
process_argv = argv;
909+
process_argc = argc;
910+
911+
/* Calculate how much memory we need for the argv strings. */
912+
size = 0;
913+
for (i = 0; i < argc; i++)
914+
size += strlen(argv[i]) + 1;
915+
916+
/* Add space for the argv pointers. */
917+
size += (argc + 1) * sizeof(char*);
918+
919+
new_argv = uv__malloc(size);
920+
if (new_argv == NULL)
921+
return argv;
922+
args_mem = new_argv;
923+
924+
/* Copy over the strings and set up the pointer table. */
925+
s = (char*) &new_argv[argc + 1];
926+
for (i = 0; i < argc; i++) {
927+
size = strlen(argv[i]) + 1;
928+
memcpy(s, argv[i], size);
929+
new_argv[i] = s;
930+
s += size;
931+
}
932+
new_argv[i] = NULL;
933+
934+
return new_argv;
885935
}
886936

887937

888938
int uv_set_process_title(const char* title) {
939+
char* new_title;
940+
941+
/* We cannot free this pointer when libuv shuts down,
942+
* the process may still be using it.
943+
*/
944+
new_title = uv__strdup(title);
945+
if (new_title == NULL)
946+
return -ENOMEM;
947+
948+
/* If this is the first time this is set,
949+
* don't free and set argv[1] to NULL.
950+
*/
951+
if (process_title_ptr != NULL)
952+
uv__free(process_title_ptr);
953+
954+
process_title_ptr = new_title;
955+
956+
process_argv[0] = process_title_ptr;
957+
if (process_argc > 1)
958+
process_argv[1] = NULL;
959+
889960
return 0;
890961
}
891962

892963

893964
int uv_get_process_title(char* buffer, size_t size) {
965+
size_t len;
966+
len = strlen(process_argv[0]);
894967
if (buffer == NULL || size == 0)
895968
return -EINVAL;
969+
else if (size <= len)
970+
return -ENOBUFS;
971+
972+
memcpy(buffer, process_argv[0], len + 1);
896973

897-
buffer[0] = '\0';
898974
return 0;
899975
}
900976

901977

978+
UV_DESTRUCTOR(static void free_args_mem(void)) {
979+
uv__free(args_mem); /* Keep valgrind happy. */
980+
args_mem = NULL;
981+
}
982+
983+
902984
int uv_resident_set_memory(size_t* rss) {
903985
char pp[64];
904986
psinfo_t psinfo;

deps/uv/src/unix/atomic-ops.h

+18-9
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,12 @@ UV_UNUSED(static int cmpxchgi(int* ptr, int oldval, int newval)) {
4343
__compare_and_swap(ptr, &oldval, newval);
4444
return out;
4545
#elif defined(__MVS__)
46-
return __plo_CS(ptr, (unsigned int*) ptr,
47-
oldval, (unsigned int*) &newval);
46+
unsigned int op4;
47+
if (__plo_CSST(ptr, (unsigned int*) &oldval, newval,
48+
(unsigned int*) ptr, *ptr, &op4))
49+
return oldval;
50+
else
51+
return op4;
4852
#else
4953
return __sync_val_compare_and_swap(ptr, oldval, newval);
5054
#endif
@@ -67,13 +71,18 @@ UV_UNUSED(static long cmpxchgl(long* ptr, long oldval, long newval)) {
6771
# endif /* if defined(__64BIT__) */
6872
return out;
6973
#elif defined (__MVS__)
70-
# ifdef _LP64
71-
return __plo_CSGR(ptr, (unsigned long long*) ptr,
72-
oldval, (unsigned long long*) &newval);
73-
# else
74-
return __plo_CS(ptr, (unsigned int*) ptr,
75-
oldval, (unsigned int*) &newval);
76-
# endif
74+
#ifdef _LP64
75+
unsigned long long op4;
76+
if (__plo_CSSTGR(ptr, (unsigned long long*) &oldval, newval,
77+
(unsigned long long*) ptr, *ptr, &op4))
78+
#else
79+
unsigned long op4;
80+
if (__plo_CSST(ptr, (unsigned int*) &oldval, newval,
81+
(unsigned int*) ptr, *ptr, &op4))
82+
#endif
83+
return oldval;
84+
else
85+
return op4;
7786
#else
7887
return __sync_val_compare_and_swap(ptr, oldval, newval);
7988
#endif

deps/uv/src/unix/core.c

+3
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,9 @@ int uv__close_nocheckstdio(int fd) {
517517

518518
int uv__close(int fd) {
519519
assert(fd > STDERR_FILENO); /* Catch stdio close bugs. */
520+
#if defined(__MVS__)
521+
epoll_file_close(fd);
522+
#endif
520523
return uv__close_nocheckstdio(fd);
521524
}
522525

0 commit comments

Comments
 (0)