Windows: uv_spawn2 reports the wrong error when setuid/setgid is specified

This commit is contained in:
Bert Belder 2012-04-27 21:58:44 +02:00
parent aea5db5da1
commit d41cc9118d
2 changed files with 3 additions and 1 deletions

View File

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

View File

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