Skip to content
This repository has been archived by the owner on May 4, 2018. It is now read-only.

Commit

Permalink
Windows: uv_spawn2 reports the wrong error when setuid/setgid is spec…
Browse files Browse the repository at this point in the history
…ified
  • Loading branch information
piscisaureus committed Apr 27, 2012
1 parent aea5db5 commit d41cc91
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/win/process.c
Expand Up @@ -873,7 +873,7 @@ int uv_spawn2(uv_loop_t* loop, uv_process_t* process,
PROCESS_INFORMATION info;

if (options.flags & (UV_PROCESS_SETGID | UV_PROCESS_SETUID)) {
uv__set_sys_error(loop, UV_ENOTSUP);
uv__set_artificial_error(loop, UV_ENOTSUP);
return -1;
}

Expand Down
2 changes: 2 additions & 0 deletions test/test-spawn.c
Expand Up @@ -610,6 +610,7 @@ TEST_IMPL(spawn_setuid_fails) {

r = uv_spawn2(uv_default_loop(), &process, options2);
ASSERT(r == -1);
ASSERT(uv_last_error(uv_default_loop()).code == UV_ENOTSUP);

r = uv_run(uv_default_loop());
ASSERT(r == 0);
Expand All @@ -630,6 +631,7 @@ TEST_IMPL(spawn_setgid_fails) {

r = uv_spawn2(uv_default_loop(), &process, options2);
ASSERT(r == -1);
ASSERT(uv_last_error(uv_default_loop()).code == UV_ENOTSUP);

r = uv_run(uv_default_loop());
ASSERT(r == 0);
Expand Down

0 comments on commit d41cc91

Please sign in to comment.