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

Commit

Permalink
windows/uv_spawn: ignore errors when duplicating fd 0-2 fails
Browse files Browse the repository at this point in the history
Hopefully this fixes nodejs/node-v0.x-archive#3779.
  • Loading branch information
piscisaureus committed Jul 31, 2012
1 parent ed2bc23 commit 9d71d1c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/win/process-stdio.c
Expand Up @@ -330,6 +330,13 @@ int uv__stdio_create(uv_loop_t* loop, uv_process_options_t* options,

/* Make an inheritable duplicate of the handle. */
if (uv__duplicate_fd(loop, fdopt.data.fd, &child_handle) < 0) {
/* If fdopt.data.fd is not valid and fd fd <= 2, then ignore the */
/* error. */
if (fdopt.data.fd <= 2 && loop->last_err.code == UV_EBADF) {
CHILD_STDIO_CRT_FLAGS(buffer, i) = 0;
CHILD_STDIO_HANDLE(buffer, i) = NULL;
break;
}
goto error;
}

Expand Down

0 comments on commit 9d71d1c

Please sign in to comment.