Skip to content

Commit 2307653

Browse files
cjihrigMylesBorins
authored andcommittedNov 11, 2018
deps: upgrade to libuv 1.20.2
Backport-PR-URL: #24103 PR-URL: #20129 Fixes: #20112 Fixes: #19903 Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Richard Lau <riclau@uk.ibm.com>
1 parent a1b94d3 commit 2307653

16 files changed

+268
-129
lines changed
 

‎deps/uv/AUTHORS

+5
Original file line numberDiff line numberDiff line change
@@ -332,3 +332,8 @@ Ryuichi KAWAMATA <ryuichi.kawamata@dena.jp>
332332
Joyee Cheung <joyeec9h3@gmail.com>
333333
Michael Kilburn <crusader.mike@gmail.com>
334334
Ruslan Bekenev <furyinbox@gmail.com>
335+
Bob Burger <rgburger@beckman.com>
336+
Thomas Versteeg <thomasversteeg@gmx.com>
337+
zzzjim <zzzjim@users.noreply.github.com>
338+
Alex Arslan <ararslan@comcast.net>
339+
Kyle Farnung <kfarnung@microsoft.com>

‎deps/uv/ChangeLog

+36
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,39 @@
1+
2018.04.23, Version 1.20.2 (Stable), c51fd3f66bbb386a1efdeba6812789f35a372d1e
2+
3+
Changes since version 1.20.1:
4+
5+
* zos: use custom semaphore (jBarz)
6+
7+
* win: fix registry API error handling (Kyle Farnung)
8+
9+
* build: add support for 64-bit AIX (Richard Lau)
10+
11+
* aix: guard STATIC_ASSERT for glibc work around (Richard Lau)
12+
13+
14+
2018.04.19, Version 1.20.1 (Stable), 36ac2fc8edfd5ff3e9be529be1d4a3f0d5364e94
15+
16+
Changes since version 1.20.0:
17+
18+
* doc,fs: improve documentation (Bob Burger)
19+
20+
* win: return a floored double from uv_uptime() (Refael Ackermann)
21+
22+
* doc: clarify platform specific pipe naming (Thomas Versteeg)
23+
24+
* unix: fix uv_pipe_chmod() on macOS (zzzjim)
25+
26+
* unix: work around glibc semaphore race condition (Anna Henningsen)
27+
28+
* tcp,openbsd: disable Unix TCP check for IPV6_ONLY (Alex Arslan)
29+
30+
* test,openbsd: use RETURN_SKIP in UDP IPv6 tests (Alex Arslan)
31+
32+
* test,openbsd: fix multicast test (Alex Arslan)
33+
34+
* Revert "win, fs: use FILE_WRITE_ATTRIBUTES when opening files" (cjihrig)
35+
36+
137
2018.04.03, Version 1.20.0 (Stable), 0012178ee2b04d9e4a2c66c27cf8891ad8325ceb
238

339
Changes since version 1.19.2:

‎deps/uv/common.gypi

+5-1
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@
134134
}]
135135
]
136136
}],
137-
['OS in "freebsd dragonflybsd linux openbsd solaris android"', {
137+
['OS in "freebsd dragonflybsd linux openbsd solaris android aix"', {
138138
'cflags': [ '-Wall' ],
139139
'cflags_cc': [ '-fno-rtti', '-fno-exceptions' ],
140140
'target_conditions': [
@@ -162,6 +162,10 @@
162162
'cflags': [ '-pthread' ],
163163
'ldflags': [ '-pthread' ],
164164
}],
165+
[ 'OS=="aix" and target_arch=="ppc64"', {
166+
'cflags': [ '-maix64' ],
167+
'ldflags': [ '-maix64' ],
168+
}],
165169
],
166170
}],
167171
['OS=="mac"', {

‎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.20.0], [https://github.com/libuv/libuv/issues])
16+
AC_INIT([libuv], [1.20.2], [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/fs.rst

+4-2
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,8 @@ Public members
148148

149149
.. c:member:: void* uv_fs_t.ptr
150150
151-
Stores the result of :c:func:`uv_fs_readlink` and serves as an alias to
152-
`statbuf`.
151+
Stores the result of :c:func:`uv_fs_readlink` and
152+
:c:func:`uv_fs_realpath` and serves as an alias to `statbuf`.
153153

154154
.. seealso:: The :c:type:`uv_req_t` members also apply.
155155

@@ -311,10 +311,12 @@ API
311311
.. c:function:: int uv_fs_readlink(uv_loop_t* loop, uv_fs_t* req, const char* path, uv_fs_cb cb)
312312
313313
Equivalent to :man:`readlink(2)`.
314+
The resulting string is stored in `req->ptr`.
314315
315316
.. c:function:: int uv_fs_realpath(uv_loop_t* loop, uv_fs_t* req, const char* path, uv_fs_cb cb)
316317
317318
Equivalent to :man:`realpath(3)` on Unix. Windows uses `GetFinalPathNameByHandle <https://msdn.microsoft.com/en-us/library/windows/desktop/aa364962(v=vs.85).aspx>`_.
319+
The resulting string is stored in `req->ptr`.
318320
319321
.. warning::
320322
This function has certain platform-specific caveats that were discovered when used in Node.

‎deps/uv/include/uv-os390.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#ifndef UV_MVS_H
2323
#define UV_MVS_H
2424

25-
#define UV_PLATFORM_SEM_T int
25+
#define UV_PLATFORM_SEM_T long
2626

2727
#define UV_PLATFORM_LOOP_FIELDS \
2828
void* ep; \

‎deps/uv/include/uv-version.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
#define UV_VERSION_MAJOR 1
3434
#define UV_VERSION_MINOR 20
35-
#define UV_VERSION_PATCH 0
35+
#define UV_VERSION_PATCH 2
3636
#define UV_VERSION_IS_RELEASE 1
3737
#define UV_VERSION_SUFFIX ""
3838

‎deps/uv/src/unix/pipe.c

+20-15
Original file line numberDiff line numberDiff line change
@@ -319,21 +319,6 @@ int uv_pipe_chmod(uv_pipe_t* handle, int mode) {
319319
mode != (UV_WRITABLE | UV_READABLE))
320320
return UV_EINVAL;
321321

322-
if (fstat(uv__stream_fd(handle), &pipe_stat) == -1)
323-
return UV__ERR(errno);
324-
325-
desired_mode = 0;
326-
if (mode & UV_READABLE)
327-
desired_mode |= S_IRUSR | S_IRGRP | S_IROTH;
328-
if (mode & UV_WRITABLE)
329-
desired_mode |= S_IWUSR | S_IWGRP | S_IWOTH;
330-
331-
/* Exit early if pipe already has desired mode. */
332-
if ((pipe_stat.st_mode & desired_mode) == desired_mode)
333-
return 0;
334-
335-
pipe_stat.st_mode |= desired_mode;
336-
337322
/* Unfortunately fchmod does not work on all platforms, we will use chmod. */
338323
name_len = 0;
339324
r = uv_pipe_getsockname(handle, NULL, &name_len);
@@ -350,6 +335,26 @@ int uv_pipe_chmod(uv_pipe_t* handle, int mode) {
350335
return r;
351336
}
352337

338+
/* stat must be used as fstat has a bug on Darwin */
339+
if (stat(name_buffer, &pipe_stat) == -1) {
340+
uv__free(name_buffer);
341+
return -errno;
342+
}
343+
344+
desired_mode = 0;
345+
if (mode & UV_READABLE)
346+
desired_mode |= S_IRUSR | S_IRGRP | S_IROTH;
347+
if (mode & UV_WRITABLE)
348+
desired_mode |= S_IWUSR | S_IWGRP | S_IWOTH;
349+
350+
/* Exit early if pipe already has desired mode. */
351+
if ((pipe_stat.st_mode & desired_mode) == desired_mode) {
352+
uv__free(name_buffer);
353+
return 0;
354+
}
355+
356+
pipe_stat.st_mode |= desired_mode;
357+
353358
r = chmod(name_buffer, pipe_stat.st_mode);
354359
uv__free(name_buffer);
355360

‎deps/uv/src/unix/tcp.c

+2
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ int uv__tcp_bind(uv_tcp_t* tcp,
164164
if (setsockopt(tcp->io_watcher.fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)))
165165
return UV__ERR(errno);
166166

167+
#ifndef __OpenBSD__
167168
#ifdef IPV6_V6ONLY
168169
if (addr->sa_family == AF_INET6) {
169170
on = (flags & UV_TCP_IPV6ONLY) != 0;
@@ -179,6 +180,7 @@ int uv__tcp_bind(uv_tcp_t* tcp,
179180
return UV__ERR(errno);
180181
}
181182
}
183+
#endif
182184
#endif
183185

184186
errno = 0;

‎deps/uv/src/unix/thread.c

+142-59
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@
3737
#include <sys/sem.h>
3838
#endif
3939

40+
#ifdef __GLIBC__
41+
#include <gnu/libc-version.h> /* gnu_get_libc_version() */
42+
#endif
43+
4044
#undef NANOSEC
4145
#define NANOSEC ((uint64_t) 1e9)
4246

@@ -419,109 +423,145 @@ int uv_sem_trywait(uv_sem_t* sem) {
419423
return UV_EINVAL; /* Satisfy the compiler. */
420424
}
421425

426+
#else /* !(defined(__APPLE__) && defined(__MACH__)) */
427+
428+
#ifdef __GLIBC__
429+
430+
/* Hack around https://sourceware.org/bugzilla/show_bug.cgi?id=12674
431+
* by providing a custom implementation for glibc < 2.21 in terms of other
432+
* concurrency primitives.
433+
* Refs: https://github.com/nodejs/node/issues/19903 */
434+
435+
/* To preserve ABI compatibility, we treat the uv_sem_t as storage for
436+
* a pointer to the actual struct we're using underneath. */
437+
438+
static uv_once_t glibc_version_check_once = UV_ONCE_INIT;
439+
static int platform_needs_custom_semaphore = 0;
440+
441+
static void glibc_version_check(void) {
442+
const char* version = gnu_get_libc_version();
443+
platform_needs_custom_semaphore =
444+
version[0] == '2' && version[1] == '.' &&
445+
atoi(version + 2) < 21;
446+
}
447+
422448
#elif defined(__MVS__)
423449

424-
int uv_sem_init(uv_sem_t* sem, unsigned int value) {
425-
uv_sem_t semid;
450+
#define platform_needs_custom_semaphore 1
451+
452+
#else /* !defined(__GLIBC__) && !defined(__MVS__) */
453+
454+
#define platform_needs_custom_semaphore 0
455+
456+
#endif
457+
458+
typedef struct uv_semaphore_s {
459+
uv_mutex_t mutex;
460+
uv_cond_t cond;
461+
unsigned int value;
462+
} uv_semaphore_t;
463+
464+
#if defined(__GLIBC__) || platform_needs_custom_semaphore
465+
STATIC_ASSERT(sizeof(uv_sem_t) >= sizeof(uv_semaphore_t*));
466+
#endif
467+
468+
static int uv__custom_sem_init(uv_sem_t* sem_, unsigned int value) {
426469
int err;
427-
union {
428-
int val;
429-
struct semid_ds* buf;
430-
unsigned short* array;
431-
} arg;
470+
uv_semaphore_t* sem;
432471

472+
sem = uv__malloc(sizeof(*sem));
473+
if (sem == NULL)
474+
return UV_ENOMEM;
433475

434-
semid = semget(IPC_PRIVATE, 1, S_IRUSR | S_IWUSR);
435-
if (semid == -1)
436-
return UV__ERR(errno);
476+
if ((err = uv_mutex_init(&sem->mutex)) != 0) {
477+
uv__free(sem);
478+
return err;
479+
}
437480

438-
arg.val = value;
439-
if (-1 == semctl(semid, 0, SETVAL, arg)) {
440-
err = errno;
441-
if (-1 == semctl(*sem, 0, IPC_RMID))
442-
abort();
443-
return UV__ERR(err);
481+
if ((err = uv_cond_init(&sem->cond)) != 0) {
482+
uv_mutex_destroy(&sem->mutex);
483+
uv__free(sem);
484+
return err;
444485
}
445486

446-
*sem = semid;
487+
sem->value = value;
488+
*(uv_semaphore_t**)sem_ = sem;
447489
return 0;
448490
}
449491

450-
void uv_sem_destroy(uv_sem_t* sem) {
451-
if (-1 == semctl(*sem, 0, IPC_RMID))
452-
abort();
492+
493+
static void uv__custom_sem_destroy(uv_sem_t* sem_) {
494+
uv_semaphore_t* sem;
495+
496+
sem = *(uv_semaphore_t**)sem_;
497+
uv_cond_destroy(&sem->cond);
498+
uv_mutex_destroy(&sem->mutex);
499+
uv__free(sem);
453500
}
454501

455-
void uv_sem_post(uv_sem_t* sem) {
456-
struct sembuf buf;
457502

458-
buf.sem_num = 0;
459-
buf.sem_op = 1;
460-
buf.sem_flg = 0;
503+
static void uv__custom_sem_post(uv_sem_t* sem_) {
504+
uv_semaphore_t* sem;
461505

462-
if (-1 == semop(*sem, &buf, 1))
463-
abort();
506+
sem = *(uv_semaphore_t**)sem_;
507+
uv_mutex_lock(&sem->mutex);
508+
sem->value++;
509+
if (sem->value == 1)
510+
uv_cond_signal(&sem->cond);
511+
uv_mutex_unlock(&sem->mutex);
464512
}
465513

466-
void uv_sem_wait(uv_sem_t* sem) {
467-
struct sembuf buf;
468-
int op_status;
469-
470-
buf.sem_num = 0;
471-
buf.sem_op = -1;
472-
buf.sem_flg = 0;
473514

474-
do
475-
op_status = semop(*sem, &buf, 1);
476-
while (op_status == -1 && errno == EINTR);
515+
static void uv__custom_sem_wait(uv_sem_t* sem_) {
516+
uv_semaphore_t* sem;
477517

478-
if (op_status)
479-
abort();
518+
sem = *(uv_semaphore_t**)sem_;
519+
uv_mutex_lock(&sem->mutex);
520+
while (sem->value == 0)
521+
uv_cond_wait(&sem->cond, &sem->mutex);
522+
sem->value--;
523+
uv_mutex_unlock(&sem->mutex);
480524
}
481525

482-
int uv_sem_trywait(uv_sem_t* sem) {
483-
struct sembuf buf;
484-
int op_status;
485526

486-
buf.sem_num = 0;
487-
buf.sem_op = -1;
488-
buf.sem_flg = IPC_NOWAIT;
527+
static int uv__custom_sem_trywait(uv_sem_t* sem_) {
528+
uv_semaphore_t* sem;
489529

490-
do
491-
op_status = semop(*sem, &buf, 1);
492-
while (op_status == -1 && errno == EINTR);
530+
sem = *(uv_semaphore_t**)sem_;
531+
if (uv_mutex_trylock(&sem->mutex) != 0)
532+
return UV_EAGAIN;
493533

494-
if (op_status) {
495-
if (errno == EAGAIN)
496-
return UV_EAGAIN;
497-
abort();
534+
if (sem->value == 0) {
535+
uv_mutex_unlock(&sem->mutex);
536+
return UV_EAGAIN;
498537
}
499538

539+
sem->value--;
540+
uv_mutex_unlock(&sem->mutex);
541+
500542
return 0;
501543
}
502544

503-
#else /* !(defined(__APPLE__) && defined(__MACH__)) */
504-
505-
int uv_sem_init(uv_sem_t* sem, unsigned int value) {
545+
static int uv__sem_init(uv_sem_t* sem, unsigned int value) {
506546
if (sem_init(sem, 0, value))
507547
return UV__ERR(errno);
508548
return 0;
509549
}
510550

511551

512-
void uv_sem_destroy(uv_sem_t* sem) {
552+
static void uv__sem_destroy(uv_sem_t* sem) {
513553
if (sem_destroy(sem))
514554
abort();
515555
}
516556

517557

518-
void uv_sem_post(uv_sem_t* sem) {
558+
static void uv__sem_post(uv_sem_t* sem) {
519559
if (sem_post(sem))
520560
abort();
521561
}
522562

523563

524-
void uv_sem_wait(uv_sem_t* sem) {
564+
static void uv__sem_wait(uv_sem_t* sem) {
525565
int r;
526566

527567
do
@@ -533,7 +573,7 @@ void uv_sem_wait(uv_sem_t* sem) {
533573
}
534574

535575

536-
int uv_sem_trywait(uv_sem_t* sem) {
576+
static int uv__sem_trywait(uv_sem_t* sem) {
537577
int r;
538578

539579
do
@@ -549,6 +589,49 @@ int uv_sem_trywait(uv_sem_t* sem) {
549589
return 0;
550590
}
551591

592+
int uv_sem_init(uv_sem_t* sem, unsigned int value) {
593+
#ifdef __GLIBC__
594+
uv_once(&glibc_version_check_once, glibc_version_check);
595+
#endif
596+
597+
if (platform_needs_custom_semaphore)
598+
return uv__custom_sem_init(sem, value);
599+
else
600+
return uv__sem_init(sem, value);
601+
}
602+
603+
604+
void uv_sem_destroy(uv_sem_t* sem) {
605+
if (platform_needs_custom_semaphore)
606+
uv__custom_sem_destroy(sem);
607+
else
608+
uv__sem_destroy(sem);
609+
}
610+
611+
612+
void uv_sem_post(uv_sem_t* sem) {
613+
if (platform_needs_custom_semaphore)
614+
uv__custom_sem_post(sem);
615+
else
616+
uv__sem_post(sem);
617+
}
618+
619+
620+
void uv_sem_wait(uv_sem_t* sem) {
621+
if (platform_needs_custom_semaphore)
622+
uv__custom_sem_wait(sem);
623+
else
624+
uv__sem_wait(sem);
625+
}
626+
627+
628+
int uv_sem_trywait(uv_sem_t* sem) {
629+
if (platform_needs_custom_semaphore)
630+
return uv__custom_sem_trywait(sem);
631+
else
632+
return uv__sem_trywait(sem);
633+
}
634+
552635
#endif /* defined(__APPLE__) && defined(__MACH__) */
553636

554637

‎deps/uv/src/win/fs.c

-2
Original file line numberDiff line numberDiff line change
@@ -434,8 +434,6 @@ void fs__open(uv_fs_t* req) {
434434
access |= FILE_APPEND_DATA;
435435
}
436436

437-
access |= FILE_WRITE_ATTRIBUTES;
438-
439437
/*
440438
* Here is where we deviate significantly from what CRT's _open()
441439
* does. We indiscriminately use all the sharing modes, to match

‎deps/uv/src/win/util.c

+23-24
Original file line numberDiff line numberDiff line change
@@ -587,8 +587,8 @@ int uv_uptime(double* uptime) {
587587
BYTE* address = (BYTE*) object_type + object_type->DefinitionLength +
588588
counter_definition->CounterOffset;
589589
uint64_t value = *((uint64_t*) address);
590-
*uptime = (double) (object_type->PerfTime.QuadPart - value) /
591-
(double) object_type->PerfFreq.QuadPart;
590+
*uptime = floor((double) (object_type->PerfTime.QuadPart - value) /
591+
(double) object_type->PerfFreq.QuadPart);
592592
uv__free(malloced_buffer);
593593
return 0;
594594
}
@@ -615,7 +615,7 @@ int uv_cpu_info(uv_cpu_info_t** cpu_infos_ptr, int* cpu_count_ptr) {
615615
SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION* sppi;
616616
DWORD sppi_size;
617617
SYSTEM_INFO system_info;
618-
DWORD cpu_count, r, i;
618+
DWORD cpu_count, i;
619619
NTSTATUS status;
620620
ULONG result_size;
621621
int err;
@@ -670,34 +670,33 @@ int uv_cpu_info(uv_cpu_info_t** cpu_infos_ptr, int* cpu_count_ptr) {
670670

671671
assert(len > 0 && len < ARRAY_SIZE(key_name));
672672

673-
r = RegOpenKeyExW(HKEY_LOCAL_MACHINE,
674-
key_name,
675-
0,
676-
KEY_QUERY_VALUE,
677-
&processor_key);
678-
if (r != ERROR_SUCCESS) {
679-
err = GetLastError();
673+
err = RegOpenKeyExW(HKEY_LOCAL_MACHINE,
674+
key_name,
675+
0,
676+
KEY_QUERY_VALUE,
677+
&processor_key);
678+
if (err != ERROR_SUCCESS) {
680679
goto error;
681680
}
682681

683-
if (RegQueryValueExW(processor_key,
684-
L"~MHz",
685-
NULL,
686-
NULL,
687-
(BYTE*) &cpu_speed,
688-
&cpu_speed_size) != ERROR_SUCCESS) {
689-
err = GetLastError();
682+
err = RegQueryValueExW(processor_key,
683+
L"~MHz",
684+
NULL,
685+
NULL,
686+
(BYTE*)&cpu_speed,
687+
&cpu_speed_size);
688+
if (err != ERROR_SUCCESS) {
690689
RegCloseKey(processor_key);
691690
goto error;
692691
}
693692

694-
if (RegQueryValueExW(processor_key,
695-
L"ProcessorNameString",
696-
NULL,
697-
NULL,
698-
(BYTE*) &cpu_brand,
699-
&cpu_brand_size) != ERROR_SUCCESS) {
700-
err = GetLastError();
693+
err = RegQueryValueExW(processor_key,
694+
L"ProcessorNameString",
695+
NULL,
696+
NULL,
697+
(BYTE*)&cpu_brand,
698+
&cpu_brand_size);
699+
if (err != ERROR_SUCCESS) {
701700
RegCloseKey(processor_key);
702701
goto error;
703702
}

‎deps/uv/test/test-fs.c

-22
Original file line numberDiff line numberDiff line change
@@ -1367,28 +1367,6 @@ TEST_IMPL(fs_chmod) {
13671367

13681368
check_permission("test_file", 0600);
13691369

1370-
#ifdef _WIN32
1371-
/* Test clearing read-only flag from files with Archive flag cleared */
1372-
/* Make the file read-only and clear archive flag */
1373-
r = SetFileAttributes("test_file", FILE_ATTRIBUTE_READONLY);
1374-
ASSERT(r != 0);
1375-
check_permission("test_file", 0400);
1376-
1377-
r = uv_fs_open(NULL, &req, "test_file", 0, 0, NULL);
1378-
ASSERT(r >= 0);
1379-
ASSERT(req.result >= 0);
1380-
uv_fs_req_cleanup(&req);
1381-
1382-
r = uv_fs_fchmod(NULL, &req, file, 0600, NULL);
1383-
ASSERT(r == 0);
1384-
ASSERT(req.result == 0);
1385-
uv_fs_req_cleanup(&req);
1386-
1387-
check_permission("test_file", 0600);
1388-
/* Restore Archive flag for rest of the tests */
1389-
r = SetFileAttributes("test_file", FILE_ATTRIBUTE_ARCHIVE);
1390-
ASSERT(r != 0);
1391-
#endif
13921370
#ifndef _WIN32
13931371
/* async chmod */
13941372
{

‎deps/uv/test/test-pipe-set-fchmod.c

+24
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ TEST_IMPL(pipe_set_chmod) {
2727
uv_pipe_t pipe_handle;
2828
uv_loop_t* loop;
2929
int r;
30+
#ifndef _WIN32
31+
struct stat stat_buf;
32+
#endif
3033

3134
loop = uv_default_loop();
3235

@@ -44,12 +47,33 @@ TEST_IMPL(pipe_set_chmod) {
4447
RETURN_SKIP("Insufficient privileges to alter pipe fmode");
4548
}
4649
ASSERT(r == 0);
50+
#ifndef _WIN32
51+
stat(TEST_PIPENAME, &stat_buf);
52+
ASSERT(stat_buf.st_mode & S_IRUSR);
53+
ASSERT(stat_buf.st_mode & S_IRGRP);
54+
ASSERT(stat_buf.st_mode & S_IROTH);
55+
#endif
4756

4857
r = uv_pipe_chmod(&pipe_handle, UV_WRITABLE);
4958
ASSERT(r == 0);
59+
#ifndef _WIN32
60+
stat(TEST_PIPENAME, &stat_buf);
61+
ASSERT(stat_buf.st_mode & S_IWUSR);
62+
ASSERT(stat_buf.st_mode & S_IWGRP);
63+
ASSERT(stat_buf.st_mode & S_IWOTH);
64+
#endif
5065

5166
r = uv_pipe_chmod(&pipe_handle, UV_WRITABLE | UV_READABLE);
5267
ASSERT(r == 0);
68+
#ifndef _WIN32
69+
stat(TEST_PIPENAME, &stat_buf);
70+
ASSERT(stat_buf.st_mode & S_IRUSR);
71+
ASSERT(stat_buf.st_mode & S_IRGRP);
72+
ASSERT(stat_buf.st_mode & S_IROTH);
73+
ASSERT(stat_buf.st_mode & S_IWUSR);
74+
ASSERT(stat_buf.st_mode & S_IWGRP);
75+
ASSERT(stat_buf.st_mode & S_IWOTH);
76+
#endif
5377

5478
r = uv_pipe_chmod(NULL, UV_WRITABLE | UV_READABLE);
5579
ASSERT(r == UV_EBADF);

‎deps/uv/test/test-udp-ipv6.c

+2
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,8 @@ TEST_IMPL(udp_dual_stack) {
174174
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__)
175175
if (!can_ipv6_ipv4_dual())
176176
RETURN_SKIP("IPv6-IPv4 dual stack not supported");
177+
#elif defined(__OpenBSD__)
178+
RETURN_SKIP("IPv6-IPv4 dual stack not supported");
177179
#endif
178180

179181
do_test(ipv6_recv_ok, 0);

‎deps/uv/test/test-udp-multicast-join6.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,8 @@ TEST_IMPL(udp_multicast_join6) {
123123
defined(_AIX) || \
124124
defined(__MVS__) || \
125125
defined(__FreeBSD_kernel__) || \
126-
defined(__NetBSD__)
126+
defined(__NetBSD__) || \
127+
defined(__OpenBSD__)
127128
r = uv_udp_set_membership(&client, "ff02::1", "::1%lo0", UV_JOIN_GROUP);
128129
#else
129130
r = uv_udp_set_membership(&client, "ff02::1", NULL, UV_JOIN_GROUP);

0 commit comments

Comments
 (0)
Please sign in to comment.