Upgrade libuv to 2b7774a
This commit is contained in:
parent
2d13cdfd2a
commit
05727f6e3e
3
deps/uv/include/uv.h
vendored
3
deps/uv/include/uv.h
vendored
@ -116,7 +116,8 @@ typedef enum {
|
||||
UV_EAISERVICE,
|
||||
UV_EAISOCKTYPE,
|
||||
UV_ESHUTDOWN,
|
||||
UV_EEXIST
|
||||
UV_EEXIST,
|
||||
UV_ESRCH
|
||||
} uv_err_code;
|
||||
|
||||
typedef enum {
|
||||
|
2
deps/uv/src/unix/error.c
vendored
2
deps/uv/src/unix/error.c
vendored
@ -79,6 +79,7 @@ static int uv__translate_lib_error(int code) {
|
||||
case UV_ENOTCONN: return ENOTCONN;
|
||||
case UV_EEXIST: return EEXIST;
|
||||
case UV_EHOSTUNREACH: return EHOSTUNREACH;
|
||||
case UV_ESRCH: return ESRCH;
|
||||
default: return -1;
|
||||
}
|
||||
|
||||
@ -112,6 +113,7 @@ uv_err_code uv_translate_sys_error(int sys_errno) {
|
||||
case EEXIST: return UV_EEXIST;
|
||||
case EHOSTUNREACH: return UV_EHOSTUNREACH;
|
||||
case EAI_NONAME: return UV_ENOENT;
|
||||
case ESRCH: return UV_ESRCH;
|
||||
default: return UV_UNKNOWN;
|
||||
}
|
||||
|
||||
|
11
deps/uv/src/uv-common.c
vendored
11
deps/uv/src/uv-common.c
vendored
@ -121,8 +121,7 @@ void uv__set_sys_error(uv_loop_t* loop, int sys_error) {
|
||||
|
||||
|
||||
void uv__set_artificial_error(uv_loop_t* loop, uv_err_code code) {
|
||||
loop->last_err.code = code;
|
||||
loop->last_err.sys_errno_ = 0;
|
||||
loop->last_err = uv__new_artificial_error(code);
|
||||
}
|
||||
|
||||
|
||||
@ -134,6 +133,14 @@ uv_err_t uv__new_sys_error(int sys_error) {
|
||||
}
|
||||
|
||||
|
||||
uv_err_t uv__new_artificial_error(uv_err_code code) {
|
||||
uv_err_t error;
|
||||
error.code = code;
|
||||
error.sys_errno_ = 0;
|
||||
return error;
|
||||
}
|
||||
|
||||
|
||||
uv_err_t uv_last_error(uv_loop_t* loop) {
|
||||
return loop->last_err;
|
||||
}
|
||||
|
1
deps/uv/src/uv-common.h
vendored
1
deps/uv/src/uv-common.h
vendored
@ -55,6 +55,7 @@ void uv__set_error(uv_loop_t* loop, uv_err_code code, int sys_error);
|
||||
void uv__set_sys_error(uv_loop_t* loop, int sys_error);
|
||||
void uv__set_artificial_error(uv_loop_t* loop, uv_err_code code);
|
||||
uv_err_t uv__new_sys_error(int sys_error);
|
||||
uv_err_t uv__new_artificial_error(uv_err_code code);
|
||||
|
||||
int uv__tcp_bind(uv_tcp_t* handle, struct sockaddr_in addr);
|
||||
int uv__tcp_bind6(uv_tcp_t* handle, struct sockaddr_in6 addr);
|
||||
|
19
deps/uv/src/win/process.c
vendored
19
deps/uv/src/win/process.c
vendored
@ -1082,14 +1082,17 @@ static uv_err_t uv__kill(HANDLE process_handle, int signum) {
|
||||
}
|
||||
} else if (signum == 0) {
|
||||
/* Health check: is the process still alive? */
|
||||
if (GetExitCodeProcess(process_handle, &status) &&
|
||||
status == STILL_ACTIVE) {
|
||||
err = uv_ok_;
|
||||
if (GetExitCodeProcess(process_handle, &status)) {
|
||||
if (status == STILL_ACTIVE) {
|
||||
err = uv_ok_;
|
||||
} else {
|
||||
err = uv__new_artificial_error(UV_ESRCH);
|
||||
}
|
||||
} else {
|
||||
err = uv__new_sys_error(GetLastError());
|
||||
}
|
||||
} else {
|
||||
err.code = UV_ENOSYS;
|
||||
err = uv__new_artificial_error(UV_ENOSYS);
|
||||
}
|
||||
|
||||
return err;
|
||||
@ -1122,8 +1125,12 @@ uv_err_t uv_kill(int pid, int signum) {
|
||||
HANDLE process_handle = OpenProcess(PROCESS_TERMINATE |
|
||||
PROCESS_QUERY_INFORMATION, FALSE, pid);
|
||||
|
||||
if (process_handle == INVALID_HANDLE_VALUE) {
|
||||
return uv__new_sys_error(GetLastError());
|
||||
if (process_handle == NULL) {
|
||||
if (GetLastError() == ERROR_INVALID_PARAMETER) {
|
||||
return uv__new_artificial_error(UV_ESRCH);
|
||||
} else {
|
||||
return uv__new_sys_error(GetLastError());
|
||||
}
|
||||
}
|
||||
|
||||
err = uv__kill(process_handle, signum);
|
||||
|
6
deps/uv/test/test-spawn.c
vendored
6
deps/uv/test/test-spawn.c
vendored
@ -68,11 +68,13 @@ static void kill_cb(uv_process_t* process, int exit_status, int term_signal) {
|
||||
ASSERT(no_term_signal || term_signal == 15);
|
||||
uv_close((uv_handle_t*)process, close_cb);
|
||||
|
||||
/* Sending signum == 0 should check if the
|
||||
/*
|
||||
* Sending signum == 0 should check if the
|
||||
* child process is still alive, not kill it.
|
||||
* This process should be dead.
|
||||
*/
|
||||
err = uv_kill(process->pid, 0);
|
||||
ASSERT(err.code != UV_OK);
|
||||
ASSERT(err.code == UV_ESRCH);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user