libuv 1.44.1
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3884 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
parent
0556af3e07
commit
3bc428a83e
13
deps/libuv/ChangeLog
vendored
13
deps/libuv/ChangeLog
vendored
@ -1,4 +1,15 @@
|
|||||||
2022.03.07, Version 1.44.0 (Stable)
|
2022.03.09, Version 1.44.1 (Stable)
|
||||||
|
|
||||||
|
Changes since version 1.44.0:
|
||||||
|
|
||||||
|
* process: simplify uv__write_int calls (Jameson Nash)
|
||||||
|
|
||||||
|
* macos: don't use thread-unsafe strtok() (Ben Noordhuis)
|
||||||
|
|
||||||
|
* process: fix hang after NOTE_EXIT (Jameson Nash)
|
||||||
|
|
||||||
|
|
||||||
|
2022.03.07, Version 1.44.0 (Stable), d2bff508457336d808ba7148b33088f6acbfe0a6
|
||||||
|
|
||||||
Changes since version 1.43.0:
|
Changes since version 1.43.0:
|
||||||
|
|
||||||
|
2
deps/libuv/configure.ac
vendored
2
deps/libuv/configure.ac
vendored
@ -13,7 +13,7 @@
|
|||||||
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
|
|
||||||
AC_PREREQ(2.57)
|
AC_PREREQ(2.57)
|
||||||
AC_INIT([libuv], [1.44.0], [https://github.com/libuv/libuv/issues])
|
AC_INIT([libuv], [1.44.1], [https://github.com/libuv/libuv/issues])
|
||||||
AC_CONFIG_MACRO_DIR([m4])
|
AC_CONFIG_MACRO_DIR([m4])
|
||||||
m4_include([m4/libuv-extra-automake-flags.m4])
|
m4_include([m4/libuv-extra-automake-flags.m4])
|
||||||
m4_include([m4/as_case.m4])
|
m4_include([m4/as_case.m4])
|
||||||
|
2
deps/libuv/include/uv/version.h
vendored
2
deps/libuv/include/uv/version.h
vendored
@ -32,7 +32,7 @@
|
|||||||
|
|
||||||
#define UV_VERSION_MAJOR 1
|
#define UV_VERSION_MAJOR 1
|
||||||
#define UV_VERSION_MINOR 44
|
#define UV_VERSION_MINOR 44
|
||||||
#define UV_VERSION_PATCH 0
|
#define UV_VERSION_PATCH 1
|
||||||
#define UV_VERSION_IS_RELEASE 1
|
#define UV_VERSION_IS_RELEASE 1
|
||||||
#define UV_VERSION_SUFFIX ""
|
#define UV_VERSION_SUFFIX ""
|
||||||
|
|
||||||
|
13
deps/libuv/src/unix/kqueue.c
vendored
13
deps/libuv/src/unix/kqueue.c
vendored
@ -117,6 +117,7 @@ void uv__io_poll(uv_loop_t* loop, int timeout) {
|
|||||||
unsigned int revents;
|
unsigned int revents;
|
||||||
QUEUE* q;
|
QUEUE* q;
|
||||||
uv__io_t* w;
|
uv__io_t* w;
|
||||||
|
uv_process_t* process;
|
||||||
sigset_t* pset;
|
sigset_t* pset;
|
||||||
sigset_t set;
|
sigset_t set;
|
||||||
uint64_t base;
|
uint64_t base;
|
||||||
@ -284,12 +285,22 @@ void uv__io_poll(uv_loop_t* loop, int timeout) {
|
|||||||
loop->watchers[loop->nwatchers + 1] = (void*) (uintptr_t) nfds;
|
loop->watchers[loop->nwatchers + 1] = (void*) (uintptr_t) nfds;
|
||||||
for (i = 0; i < nfds; i++) {
|
for (i = 0; i < nfds; i++) {
|
||||||
ev = events + i;
|
ev = events + i;
|
||||||
|
fd = ev->ident;
|
||||||
|
|
||||||
|
/* Handle kevent NOTE_EXIT results */
|
||||||
if (ev->filter == EVFILT_PROC) {
|
if (ev->filter == EVFILT_PROC) {
|
||||||
|
QUEUE_FOREACH(q, &loop->process_handles) {
|
||||||
|
process = QUEUE_DATA(q, uv_process_t, queue);
|
||||||
|
if (process->pid == fd) {
|
||||||
|
process->flags |= UV_HANDLE_REAP;
|
||||||
loop->flags |= UV_LOOP_REAP_CHILDREN;
|
loop->flags |= UV_LOOP_REAP_CHILDREN;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
nevents++;
|
nevents++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
fd = ev->ident;
|
|
||||||
/* Skip invalidated events, see uv__platform_invalidate_fd */
|
/* Skip invalidated events, see uv__platform_invalidate_fd */
|
||||||
if (fd == -1)
|
if (fd == -1)
|
||||||
continue;
|
continue;
|
||||||
|
81
deps/libuv/src/unix/process.c
vendored
81
deps/libuv/src/unix/process.c
vendored
@ -63,12 +63,18 @@ extern char **environ;
|
|||||||
# include "zos-base.h"
|
# include "zos-base.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__APPLE__) || defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__)
|
#if defined(__APPLE__) || \
|
||||||
|
defined(__DragonFly__) || \
|
||||||
|
defined(__FreeBSD__) || \
|
||||||
|
defined(__NetBSD__) || \
|
||||||
|
defined(__OpenBSD__)
|
||||||
#include <sys/event.h>
|
#include <sys/event.h>
|
||||||
|
#else
|
||||||
|
#define UV_USE_SIGCHLD
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#if !(defined(__APPLE__) || defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__))
|
#ifdef UV_USE_SIGCHLD
|
||||||
static void uv__chld(uv_signal_t* handle, int signum) {
|
static void uv__chld(uv_signal_t* handle, int signum) {
|
||||||
assert(signum == SIGCHLD);
|
assert(signum == SIGCHLD);
|
||||||
uv__wait_children(handle->loop);
|
uv__wait_children(handle->loop);
|
||||||
@ -80,6 +86,7 @@ void uv__wait_children(uv_loop_t* loop) {
|
|||||||
int exit_status;
|
int exit_status;
|
||||||
int term_signal;
|
int term_signal;
|
||||||
int status;
|
int status;
|
||||||
|
int options;
|
||||||
pid_t pid;
|
pid_t pid;
|
||||||
QUEUE pending;
|
QUEUE pending;
|
||||||
QUEUE* q;
|
QUEUE* q;
|
||||||
@ -93,19 +100,33 @@ void uv__wait_children(uv_loop_t* loop) {
|
|||||||
process = QUEUE_DATA(q, uv_process_t, queue);
|
process = QUEUE_DATA(q, uv_process_t, queue);
|
||||||
q = QUEUE_NEXT(q);
|
q = QUEUE_NEXT(q);
|
||||||
|
|
||||||
|
#ifndef UV_USE_SIGCHLD
|
||||||
|
if ((process->flags & UV_HANDLE_REAP) == 0)
|
||||||
|
continue;
|
||||||
|
options = 0;
|
||||||
|
process->flags &= ~UV_HANDLE_REAP;
|
||||||
|
#else
|
||||||
|
options = WNOHANG;
|
||||||
|
#endif
|
||||||
|
|
||||||
do
|
do
|
||||||
pid = waitpid(process->pid, &status, WNOHANG);
|
pid = waitpid(process->pid, &status, options);
|
||||||
while (pid == -1 && errno == EINTR);
|
while (pid == -1 && errno == EINTR);
|
||||||
|
|
||||||
if (pid == 0)
|
#ifdef UV_USE_SIGCHLD
|
||||||
|
if (pid == 0) /* Not yet exited */
|
||||||
continue;
|
continue;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (pid == -1) {
|
if (pid == -1) {
|
||||||
if (errno != ECHILD)
|
if (errno != ECHILD)
|
||||||
abort();
|
abort();
|
||||||
|
/* The child died, and we missed it. This probably means someone else
|
||||||
|
* stole the waitpid from us. Handle this by not handling it at all. */
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
assert(pid == process->pid);
|
||||||
process->status = status;
|
process->status = status;
|
||||||
QUEUE_REMOVE(&process->queue);
|
QUEUE_REMOVE(&process->queue);
|
||||||
QUEUE_INSERT_TAIL(&pending, &process->queue);
|
QUEUE_INSERT_TAIL(&pending, &process->queue);
|
||||||
@ -216,16 +237,14 @@ static void uv__write_int(int fd, int val) {
|
|||||||
n = write(fd, &val, sizeof(val));
|
n = write(fd, &val, sizeof(val));
|
||||||
while (n == -1 && errno == EINTR);
|
while (n == -1 && errno == EINTR);
|
||||||
|
|
||||||
if (n == -1 && errno == EPIPE)
|
/* The write might have failed (e.g. if the parent process has died),
|
||||||
return; /* parent process has quit */
|
* but we have nothing left but to _exit ourself now too. */
|
||||||
|
_exit(127);
|
||||||
assert(n == sizeof(val));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void uv__write_errno(int error_fd) {
|
static void uv__write_errno(int error_fd) {
|
||||||
uv__write_int(error_fd, UV__ERR(errno));
|
uv__write_int(error_fd, UV__ERR(errno));
|
||||||
_exit(127);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -284,10 +303,8 @@ static void uv__process_child_init(const uv_process_options_t* options,
|
|||||||
uv__write_errno(error_fd);
|
uv__write_errno(error_fd);
|
||||||
#ifndef F_DUPFD_CLOEXEC /* POSIX 2008 */
|
#ifndef F_DUPFD_CLOEXEC /* POSIX 2008 */
|
||||||
n = uv__cloexec(pipes[fd][1], 1);
|
n = uv__cloexec(pipes[fd][1], 1);
|
||||||
if (n) {
|
if (n)
|
||||||
uv__write_int(error_fd, n);
|
uv__write_int(error_fd, n);
|
||||||
_exit(127);
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -313,10 +330,8 @@ static void uv__process_child_init(const uv_process_options_t* options,
|
|||||||
if (fd == use_fd) {
|
if (fd == use_fd) {
|
||||||
if (close_fd == -1) {
|
if (close_fd == -1) {
|
||||||
n = uv__cloexec(use_fd, 0);
|
n = uv__cloexec(use_fd, 0);
|
||||||
if (n) {
|
if (n)
|
||||||
uv__write_int(error_fd, n);
|
uv__write_int(error_fd, n);
|
||||||
_exit(127);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -368,7 +383,6 @@ static void uv__process_child_init(const uv_process_options_t* options,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
uv__write_errno(error_fd);
|
uv__write_errno(error_fd);
|
||||||
abort();
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -394,30 +408,22 @@ static void uv__spawn_init_posix_spawn_fncs(void) {
|
|||||||
|
|
||||||
|
|
||||||
static void uv__spawn_init_can_use_setsid(void) {
|
static void uv__spawn_init_can_use_setsid(void) {
|
||||||
static const int MACOS_CATALINA_VERSION_MAJOR = 19;
|
int which[] = {CTL_KERN, KERN_OSRELEASE};
|
||||||
char version_str[256];
|
unsigned major;
|
||||||
char* version_major_str;
|
unsigned minor;
|
||||||
size_t version_str_size = 256;
|
unsigned patch;
|
||||||
int r;
|
char buf[256];
|
||||||
int version_major;
|
size_t len;
|
||||||
|
|
||||||
/* Get a version string */
|
len = sizeof(buf);
|
||||||
r = sysctlbyname("kern.osrelease", version_str, &version_str_size, NULL, 0);
|
if (sysctl(which, ARRAY_SIZE(which), buf, &len, NULL, 0))
|
||||||
if (r != 0)
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* Try to get the major version number. If not found
|
/* NULL specifies to use LC_C_LOCALE */
|
||||||
* fall back to the fork/exec flow */
|
if (3 != sscanf_l(buf, NULL, "%u.%u.%u", &major, &minor, &patch))
|
||||||
version_major_str = strtok(version_str, ".");
|
|
||||||
if (version_major_str == NULL)
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* Parse the version major as a number. If it is greater than
|
posix_spawn_can_use_setsid = (major >= 19); /* macOS Catalina */
|
||||||
* the major version for macOS Catalina (aka macOS 10.15), then
|
|
||||||
* the POSIX_SPAWN_SETSID flag is available */
|
|
||||||
version_major = atoi_l(version_major_str, NULL); /* Use LC_C_LOCALE */
|
|
||||||
if (version_major >= MACOS_CATALINA_VERSION_MAJOR)
|
|
||||||
posix_spawn_can_use_setsid = 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -980,7 +986,7 @@ int uv_spawn(uv_loop_t* loop,
|
|||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !(defined(__APPLE__) || defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__))
|
#ifdef UV_USE_SIGCHLD
|
||||||
uv_signal_start(&loop->child_watcher, uv__chld, SIGCHLD);
|
uv_signal_start(&loop->child_watcher, uv__chld, SIGCHLD);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -999,13 +1005,14 @@ int uv_spawn(uv_loop_t* loop,
|
|||||||
* fail to open a stdio handle. This ensures we can eventually reap the child
|
* fail to open a stdio handle. This ensures we can eventually reap the child
|
||||||
* with waitpid. */
|
* with waitpid. */
|
||||||
if (exec_errorno == 0) {
|
if (exec_errorno == 0) {
|
||||||
#if defined(__APPLE__) || defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__)
|
#ifndef UV_USE_SIGCHLD
|
||||||
struct kevent event;
|
struct kevent event;
|
||||||
EV_SET(&event, pid, EVFILT_PROC, EV_ADD | EV_ONESHOT, NOTE_EXIT, 0, 0);
|
EV_SET(&event, pid, EVFILT_PROC, EV_ADD | EV_ONESHOT, NOTE_EXIT, 0, 0);
|
||||||
if (kevent(loop->backend_fd, &event, 1, NULL, 0, NULL)) {
|
if (kevent(loop->backend_fd, &event, 1, NULL, 0, NULL)) {
|
||||||
if (errno != ESRCH)
|
if (errno != ESRCH)
|
||||||
abort();
|
abort();
|
||||||
/* Process already exited. Call waitpid on the next loop iteration. */
|
/* Process already exited. Call waitpid on the next loop iteration. */
|
||||||
|
process->flags |= UV_HANDLE_REAP;
|
||||||
loop->flags |= UV_LOOP_REAP_CHILDREN;
|
loop->flags |= UV_LOOP_REAP_CHILDREN;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
5
deps/libuv/src/uv-common.h
vendored
5
deps/libuv/src/uv-common.h
vendored
@ -130,7 +130,10 @@ enum {
|
|||||||
UV_SIGNAL_ONE_SHOT = 0x02000000,
|
UV_SIGNAL_ONE_SHOT = 0x02000000,
|
||||||
|
|
||||||
/* Only used by uv_poll_t handles. */
|
/* Only used by uv_poll_t handles. */
|
||||||
UV_HANDLE_POLL_SLOW = 0x01000000
|
UV_HANDLE_POLL_SLOW = 0x01000000,
|
||||||
|
|
||||||
|
/* Only used by uv_process_t handles. */
|
||||||
|
UV_HANDLE_REAP = 0x10000000
|
||||||
};
|
};
|
||||||
|
|
||||||
int uv__loop_configure(uv_loop_t* loop, uv_loop_option option, va_list ap);
|
int uv__loop_configure(uv_loop_t* loop, uv_loop_option option, va_list ap);
|
||||||
|
Loading…
Reference in New Issue
Block a user