Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add UV_ESRCH

Fixes #239.
  • Loading branch information...
commit a378110f9ecda407cd68b1061d70c7d105957e6c 1 parent b7da0a6
TJ Holowaychuk authored ry committed
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
3  include/uv.h
View
@@ -116,7 +116,8 @@ typedef enum {
UV_EAISERVICE,
UV_EAISOCKTYPE,
UV_ESHUTDOWN,
- UV_EEXIST
+ UV_EEXIST,
+ UV_ESRCH
} uv_err_code;
typedef enum {
2  src/unix/error.c
View
@@ -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;
}
6 test/test-spawn.c
View
@@ -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);
}
Please sign in to comment.
Something went wrong with that request. Please try again.