diff --git a/include/uv.h b/include/uv.h index 88afed44..175840cf 100644 --- a/include/uv.h +++ b/include/uv.h @@ -116,7 +116,8 @@ typedef enum { UV_EAISERVICE, UV_EAISOCKTYPE, UV_ESHUTDOWN, - UV_EEXIST + UV_EEXIST, + UV_ESRCH } uv_err_code; typedef enum { diff --git a/src/unix/error.c b/src/unix/error.c index ac8bdd72..f79d2db1 100644 --- a/src/unix/error.c +++ b/src/unix/error.c @@ -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; } diff --git a/test/test-spawn.c b/test/test-spawn.c index 192644ba..68720114 100644 --- a/test/test-spawn.c +++ b/test/test-spawn.c @@ -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); }