test: allow UV_EACCES in spawn_fails

Allow UV_EACCES as a successful return value when uv_spawn fails.

When the PATH environment variable contains a directory which the
user cannot access, execvp may return EACCES instead of ENOENT.

fix #1045.
This commit is contained in:
Joshua Neuheisel 2013-12-15 21:28:50 -05:00 committed by Fedor Indutny
parent a762934aa8
commit b44edf313c

View File

@ -146,10 +146,13 @@ static void timer_cb(uv_timer_t* handle, int status) {
TEST_IMPL(spawn_fails) {
int r;
init_process_options("", fail_cb);
options.file = options.args[0] = "program-that-had-better-not-exist";
ASSERT(UV_ENOENT == uv_spawn(uv_default_loop(), &process, &options));
r = uv_spawn(uv_default_loop(), &process, &options);
ASSERT(r == UV_ENOENT || r == UV_EACCES);
ASSERT(0 == uv_is_active((uv_handle_t*) &process));
ASSERT(0 == uv_run(uv_default_loop(), UV_RUN_DEFAULT));