Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Add UV_ESRCH

Fixes #239.
  • Loading branch information...
tj authored and ry committed Nov 7, 2011
1 parent b7da0a6 commit a378110f9ecda407cd68b1061d70c7d105957e6c
Showing with 8 additions and 3 deletions.
  1. +2 −1 include/uv.h
  2. +2 −0 src/unix/error.c
  3. +4 −2 test/test-spawn.c
@@ -116,7 +116,8 @@ typedef enum {
UV_EAISERVICE,
UV_EAISOCKTYPE,
UV_ESHUTDOWN,
UV_EEXIST
UV_EEXIST,
UV_ESRCH
} uv_err_code;

typedef enum {
@@ -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;
}

@@ -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);
}


0 comments on commit a378110

Please sign in to comment.
You can’t perform that action at this time.