Skip to content

Commit c0859d7

Browse files
cjihrigtargos
authored andcommitted
deps: upgrade to libuv 1.25.0
PR-URL: #25571 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
1 parent 8f42c9e commit c0859d7

38 files changed

+779
-360
lines changed

deps/uv/.mailmap

+1
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,4 @@ Yazhong Liu <yorkiefixer@gmail.com>
4545
Yuki Okumura <mjt@cltn.org>
4646
jBarz <jBarz@users.noreply.github.com> <jbarboza@ca.ibm.com>
4747
jBarz <jBarz@users.noreply.github.com> <jbarz@users.noreply.github.com>
48+
ptlomholt <pt@lomholt.com>

deps/uv/AUTHORS

+4
Original file line numberDiff line numberDiff line change
@@ -362,3 +362,7 @@ Ashe Connor <ashe@kivikakk.ee>
362362
Rick <lcw0622@163.com>
363363
Ivan Krylov <krylov.r00t@gmail.com>
364364
Michael Meier <michael.meier@leica-geosystems.com>
365+
ptlomholt <pt@lomholt.com>
366+
Victor Costan <pwnall@chromium.org>
367+
sid <sidyhe@hotmail.com>
368+
Kevin Adler <kadler@us.ibm.com>

deps/uv/CMakeLists.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ set(uv_test_sources
167167
test/test-udp-send-immediate.c
168168
test/test-udp-send-unreachable.c
169169
test/test-udp-try-send.c
170+
test/test-uname.c
170171
test/test-walk-handles.c
171172
test/test-watcher-cross-stop.c)
172173

@@ -211,7 +212,7 @@ if(WIN32)
211212
else()
212213
list(APPEND uv_defines _FILE_OFFSET_BITS=64 _LARGEFILE_SOURCE)
213214
if(NOT CMAKE_SYSTEM_NAME STREQUAL "Android")
214-
# Android has pthread as part of its c library, not as a separate
215+
# Android has pthread as part of its c library, not as a separate
215216
# libpthread.so.
216217
list(APPEND uv_libraries pthread)
217218
endif()

deps/uv/ChangeLog

+51
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,54 @@
1+
2019.01.19, Version 1.25.0 (Stable), 4a10a9d425863330af199e4b74bd688e62d945f1
2+
3+
Changes since version 1.24.1:
4+
5+
* Revert "win,fs: retry if uv_fs_rename fails" (Ben Noordhuis)
6+
7+
* aix: manually trigger fs event monitoring (Gireesh Punathil)
8+
9+
* unix: rename WRITE_RETRY_ON_ERROR macro (Ben Noordhuis)
10+
11+
* darwin: DRY platform-specific error check (Ben Noordhuis)
12+
13+
* unix: refactor uv__write() (Ben Noordhuis)
14+
15+
* unix: don't send handle twice on partial write (Ben Noordhuis)
16+
17+
* tty,win: fix Alt+key under WSL (Bartosz Sosnowski)
18+
19+
* build: support running tests in out-of-tree builds (Jameson Nash)
20+
21+
* fsevents: really watch files with fsevents on macos 10.7+ (Jameson Nash)
22+
23+
* thread,mingw64: need intrin.h header for SSE2 MemoryBarrier (Jameson Nash)
24+
25+
* win: fix sizeof-pointer-div warning (cjihrig)
26+
27+
* unix,win: add uv_os_uname() (cjihrig)
28+
29+
* win, tty: fix CreateFileW() return value check (Bartosz Sosnowski)
30+
31+
* unix: enable IPv6 tests on OpenBSD (ptlomholt)
32+
33+
* test: fix test-ipc spawn_helper exit_cb (Santiago Gimeno)
34+
35+
* test: fix test-ipc tests (Santiago Gimeno)
36+
37+
* unix: better handling of unsupported F_FULLFSYNC (Victor Costan)
38+
39+
* win,test: de-flake fs_event_watch_dir_short_path (Refael Ackermann)
40+
41+
* win: fix msvc warning (sid)
42+
43+
* openbsd: switch to libuv's barrier implementation (ptlomholt)
44+
45+
* unix,stream: fix zero byte writes (Santiago Gimeno)
46+
47+
* ibmi: return EISDIR on read from directory fd (Kevin Adler)
48+
49+
* build: wrap long lines in Makefile.am (cjihrig)
50+
51+
152
2018.12.17, Version 1.24.1 (Stable), 274f2bd3b70847cadd9a3965577a87e666ab9ac3
253

354
Changes since version 1.24.0:

deps/uv/Makefile.am

+7-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ AM_CPPFLAGS = -I$(top_srcdir)/include \
2020
include_HEADERS=include/uv.h
2121

2222
uvincludedir = $(includedir)/uv
23-
uvinclude_HEADERS=include/uv/errno.h include/uv/threadpool.h include/uv/version.h
23+
uvinclude_HEADERS = include/uv/errno.h \
24+
include/uv/threadpool.h \
25+
include/uv/version.h
2426

2527
CLEANFILES =
2628

@@ -293,6 +295,7 @@ test_run_tests_SOURCES = test/blackhole-server.c \
293295
test/test-udp-send-immediate.c \
294296
test/test-udp-send-unreachable.c \
295297
test/test-udp-try-send.c \
298+
test/test-uname.c \
296299
test/test-walk-handles.c \
297300
test/test-watcher-cross-stop.c
298301
test_run_tests_LDADD = libuv.la
@@ -306,7 +309,9 @@ test_run_tests_SOURCES += test/runner-unix.c \
306309
endif
307310

308311
if AIX
309-
test_run_tests_CFLAGS += -D_ALL_SOURCE -D_XOPEN_SOURCE=500 -D_LINUX_SOURCE_COMPAT
312+
test_run_tests_CFLAGS += -D_ALL_SOURCE \
313+
-D_XOPEN_SOURCE=500 \
314+
-D_LINUX_SOURCE_COMPAT
310315
endif
311316

312317
if LINUX

deps/uv/configure.ac

+3-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.24.1], [https://github.com/libuv/libuv/issues])
16+
AC_INIT([libuv], [1.25.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])
@@ -73,4 +73,6 @@ AS_CASE([$host_os], [kfreebsd*], [
7373
])
7474
AC_CHECK_HEADERS([sys/ahafs_evProds.h])
7575
AC_CONFIG_FILES([Makefile libuv.pc])
76+
AC_CONFIG_LINKS([test/fixtures/empty_file:test/fixtures/empty_file])
77+
AC_CONFIG_LINKS([test/fixtures/load_error.node:test/fixtures/load_error.node])
7678
AC_OUTPUT

deps/uv/docs/src/fs.rst

-9
Original file line numberDiff line numberDiff line change
@@ -233,15 +233,6 @@ API
233233
234234
Equivalent to :man:`rename(2)`.
235235
236-
.. note::
237-
On Windows if this function fails with ``UV_EBUSY``, ``UV_EPERM`` or
238-
``UV_EACCES``, it will retry to rename the file up to four times with
239-
250ms wait between attempts before giving up. If both `path` and
240-
`new_path` are existing directories this function will work only if
241-
target directory is empty.
242-
243-
.. versionchanged:: 1.24.0 Added retrying and directory move support on Windows.
244-
245236
.. c:function:: int uv_fs_fsync(uv_loop_t* loop, uv_fs_t* req, uv_file file, uv_fs_cb cb)
246237
247238
Equivalent to :man:`fsync(2)`.

deps/uv/docs/src/misc.rst

+22
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,19 @@ Data types
145145
char* homedir;
146146
} uv_passwd_t;
147147

148+
.. c:type:: uv_utsname_t
149+
150+
Data type for operating system name and version information.
151+
152+
::
153+
154+
typedef struct uv_utsname_s {
155+
char sysname[256];
156+
char release[256];
157+
char version[256];
158+
char machine[256];
159+
} uv_utsname_t;
160+
148161

149162
API
150163
---
@@ -549,3 +562,12 @@ API
549562
for others it will be silently reduced to `PRIORITY_HIGH`.
550563
551564
.. versionadded:: 1.23.0
565+
566+
.. c:function:: int uv_os_uname(uv_utsname_t* buffer)
567+
568+
Retrieves system information in `buffer`. The populated data includes the
569+
operating system name, release, version, and machine. On non-Windows
570+
systems, `uv_os_uname()` is a thin wrapper around :man:`uname(3)`. Returns
571+
zero on success, and a non-zero error value otherwise.
572+
573+
.. versionadded:: 1.25.0

deps/uv/include/uv.h

+15-2
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ typedef struct uv_cpu_info_s uv_cpu_info_t;
234234
typedef struct uv_interface_address_s uv_interface_address_t;
235235
typedef struct uv_dirent_s uv_dirent_t;
236236
typedef struct uv_passwd_s uv_passwd_t;
237+
typedef struct uv_utsname_s uv_utsname_t;
237238

238239
typedef enum {
239240
UV_LOOP_BLOCK_SIGNAL
@@ -968,13 +969,13 @@ enum uv_process_flags {
968969
*/
969970
UV_PROCESS_WINDOWS_HIDE = (1 << 4),
970971
/*
971-
* Hide the subprocess console window that would normally be created. This
972+
* Hide the subprocess console window that would normally be created. This
972973
* option is only meaningful on Windows systems. On Unix it is silently
973974
* ignored.
974975
*/
975976
UV_PROCESS_WINDOWS_HIDE_CONSOLE = (1 << 5),
976977
/*
977-
* Hide the subprocess GUI window that would normally be created. This
978+
* Hide the subprocess GUI window that would normally be created. This
978979
* option is only meaningful on Windows systems. On Unix it is silently
979980
* ignored.
980981
*/
@@ -1054,6 +1055,16 @@ struct uv_passwd_s {
10541055
char* homedir;
10551056
};
10561057

1058+
struct uv_utsname_s {
1059+
char sysname[256];
1060+
char release[256];
1061+
char version[256];
1062+
char machine[256];
1063+
/* This struct does not contain the nodename and domainname fields present in
1064+
the utsname type. domainname is a GNU extension. Both fields are referred
1065+
to as meaningless in the docs. */
1066+
};
1067+
10571068
typedef enum {
10581069
UV_DIRENT_UNKNOWN,
10591070
UV_DIRENT_FILE,
@@ -1135,6 +1146,8 @@ UV_EXTERN int uv_os_unsetenv(const char* name);
11351146

11361147
UV_EXTERN int uv_os_gethostname(char* buffer, size_t* size);
11371148

1149+
UV_EXTERN int uv_os_uname(uv_utsname_t* buffer);
1150+
11381151

11391152
typedef enum {
11401153
UV_FS_UNKNOWN = -1,

deps/uv/include/uv/unix.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,9 @@ typedef pthread_cond_t uv_cond_t;
136136
typedef pthread_key_t uv_key_t;
137137

138138
/* Note: guard clauses should match uv_barrier_init's in src/unix/thread.c. */
139-
#if defined(_AIX) || !defined(PTHREAD_BARRIER_SERIAL_THREAD)
139+
#if defined(_AIX) || \
140+
defined(__OpenBSD__) || \
141+
!defined(PTHREAD_BARRIER_SERIAL_THREAD)
140142
/* TODO(bnoordhuis) Merge into uv_barrier_t in v2. */
141143
struct _uv_barrier {
142144
uv_mutex_t mutex;

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 24
35-
#define UV_VERSION_PATCH 1
34+
#define UV_VERSION_MINOR 25
35+
#define UV_VERSION_PATCH 0
3636
#define UV_VERSION_IS_RELEASE 1
3737
#define UV_VERSION_SUFFIX ""
3838

deps/uv/src/unix/aix.c

+17-2
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ static int uv__setup_ahafs(const char* filename, int *fd) {
555555
sprintf(mon_file_write_string, "CHANGED=YES;WAIT_TYPE=WAIT_IN_SELECT;INFO_LVL=1");
556556

557557
rc = write(*fd, mon_file_write_string, strlen(mon_file_write_string)+1);
558-
if (rc < 0)
558+
if (rc < 0 && errno != EBUSY)
559559
return UV__ERR(errno);
560560

561561
return 0;
@@ -728,10 +728,16 @@ int uv_fs_event_start(uv_fs_event_t* handle,
728728
char cwd[PATH_MAX];
729729
char absolute_path[PATH_MAX];
730730
char readlink_cwd[PATH_MAX];
731+
struct timeval zt;
732+
fd_set pollfd;
731733

732734

733735
/* Figure out whether filename is absolute or not */
734-
if (filename[0] == '/') {
736+
if (filename[0] == '\0') {
737+
/* Missing a pathname */
738+
return UV_ENOENT;
739+
}
740+
else if (filename[0] == '/') {
735741
/* We have absolute pathname */
736742
/* TODO(bnoordhuis) Check uv__strscpy() return value. */
737743
uv__strscpy(absolute_path, filename, sizeof(absolute_path));
@@ -768,6 +774,15 @@ int uv_fs_event_start(uv_fs_event_t* handle,
768774

769775
uv__io_start(handle->loop, &handle->event_watcher, POLLIN);
770776

777+
/* AHAFS wants someone to poll for it to start mointoring.
778+
* so kick-start it so that we don't miss an event in the
779+
* eventuality of an event that occurs in the current loop. */
780+
do {
781+
memset(&zt, 0, sizeof(zt));
782+
FD_ZERO(&pollfd);
783+
FD_SET(fd, &pollfd);
784+
rc = select(fd + 1, &pollfd, NULL, NULL, &zt);
785+
} while (rc == -1 && errno == EINTR);
771786
return 0;
772787
#else
773788
return UV_ENOSYS;

deps/uv/src/unix/bsd-ifaddrs.c

+1-4
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,10 @@ static int uv__ifaddr_exclude(struct ifaddrs *ent, int exclude_type) {
5252
*/
5353
if (ent->ifa_addr->sa_family == AF_LINK)
5454
return 1;
55-
#elif defined(__NetBSD__)
55+
#elif defined(__NetBSD__) || defined(__OpenBSD__)
5656
if (ent->ifa_addr->sa_family != PF_INET &&
5757
ent->ifa_addr->sa_family != PF_INET6)
5858
return 1;
59-
#elif defined(__OpenBSD__)
60-
if (ent->ifa_addr->sa_family != PF_INET)
61-
return 1;
6259
#endif
6360
return 0;
6461
}

deps/uv/src/unix/core.c

+57
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
#include <sys/uio.h> /* writev */
4141
#include <sys/resource.h> /* getrusage */
4242
#include <pwd.h>
43+
#include <sys/utsname.h>
4344

4445
#ifdef __sun
4546
# include <netdb.h> /* MAXHOSTNAMELEN on Solaris */
@@ -1357,3 +1358,59 @@ int uv_os_setpriority(uv_pid_t pid, int priority) {
13571358

13581359
return 0;
13591360
}
1361+
1362+
1363+
int uv_os_uname(uv_utsname_t* buffer) {
1364+
struct utsname buf;
1365+
int r;
1366+
1367+
if (buffer == NULL)
1368+
return UV_EINVAL;
1369+
1370+
if (uname(&buf) == -1) {
1371+
r = UV__ERR(errno);
1372+
goto error;
1373+
}
1374+
1375+
r = uv__strscpy(buffer->sysname, buf.sysname, sizeof(buffer->sysname));
1376+
if (r == UV_E2BIG)
1377+
goto error;
1378+
1379+
#ifdef _AIX
1380+
r = snprintf(buffer->release,
1381+
sizeof(buffer->release),
1382+
"%s.%s",
1383+
buf.version,
1384+
buf.release);
1385+
if (r >= sizeof(buffer->release)) {
1386+
r = UV_E2BIG;
1387+
goto error;
1388+
}
1389+
#else
1390+
r = uv__strscpy(buffer->release, buf.release, sizeof(buffer->release));
1391+
if (r == UV_E2BIG)
1392+
goto error;
1393+
#endif
1394+
1395+
r = uv__strscpy(buffer->version, buf.version, sizeof(buffer->version));
1396+
if (r == UV_E2BIG)
1397+
goto error;
1398+
1399+
#if defined(_AIX) || defined(__PASE__)
1400+
r = uv__strscpy(buffer->machine, "ppc64", sizeof(buffer->machine));
1401+
#else
1402+
r = uv__strscpy(buffer->machine, buf.machine, sizeof(buffer->machine));
1403+
#endif
1404+
1405+
if (r == UV_E2BIG)
1406+
goto error;
1407+
1408+
return 0;
1409+
1410+
error:
1411+
buffer->sysname[0] = '\0';
1412+
buffer->release[0] = '\0';
1413+
buffer->version[0] = '\0';
1414+
buffer->machine[0] = '\0';
1415+
return r;
1416+
}

0 commit comments

Comments
 (0)