Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

map ESRCH #239

Closed
wants to merge 3 commits into from

2 participants

@tj
tj commented

No description provided.

@ry ry referenced this pull request in joyent/node
Closed

"Unknown system errno 3 kill" #2040

@ry
ry commented

Can we get a test for uv_kill(SOME_RANDOM_NUMBER, 0) returning UV_ESRCH?

@ry ry closed this pull request from a commit
@tj tj Add UV_ESRCH
Fixes #239.
a378110
@ry ry closed this in a378110
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 7, 2011
  1. @tj

    unix: map ESRCH

    tj authored
Commits on Nov 8, 2011
  1. @tj

    unix: ESRCH test

    tj authored
  2. @tj
This page is out of date. Refresh to see the latest.
Showing with 7 additions and 1 deletion.
  1. +2 −1  include/uv.h
  2. +2 −0  src/unix/error.c
  3. +3 −0  test/test-spawn.c
View
3  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 {
View
2  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;
}
View
3  test/test-spawn.c
@@ -289,6 +289,9 @@ TEST_IMPL(kill) {
err = uv_kill(process.pid, 0);
ASSERT(err.code == UV_OK);
+ err = uv_kill(123456, 0);
+ ASSERT(err.code == UV_ESRCH);
+
/* Kill the process. */
err = uv_kill(process.pid, /* SIGTERM */ 15);
ASSERT(err.code == UV_OK);
Something went wrong with that request. Please try again.