diff options
author | Ben Noordhuis <info@bnoordhuis.nl> | 2011-08-01 20:16:27 +0400 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2011-08-01 20:16:27 +0400 |
commit | 8da4831ed0625f55017cb22e8c9096aa5d70b795 (patch) | |
tree | efbe633977b06787dfd3290aaabbce007f135e94 /deps | |
parent | f0f941a59e42a22771583da55d78e454a58eb051 (diff) |
Upgrade libuv to 023f99a
Diffstat (limited to 'deps')
-rw-r--r-- | deps/uv/src/uv-unix.c | 25 | ||||
-rw-r--r-- | deps/uv/test/run-tests.c | 5 |
2 files changed, 16 insertions, 14 deletions
diff --git a/deps/uv/src/uv-unix.c b/deps/uv/src/uv-unix.c index 33903e0152d..85246ae4284 100644 --- a/deps/uv/src/uv-unix.c +++ b/deps/uv/src/uv-unix.c @@ -1838,6 +1838,7 @@ int uv_pipe_init(uv_pipe_t* handle) { ev_init(&handle->read_watcher, uv__stream_io); handle->write_watcher.data = handle; handle->read_watcher.data = handle; + handle->accepted_fd = -1; handle->fd = -1; ngx_queue_init(&handle->write_completed_queue); @@ -2308,17 +2309,17 @@ int uv_spawn(uv_process_t* process, uv_process_options_t options) { if (pid == 0) { if (stdin_pipe[0] >= 0) { - close(stdin_pipe[1]); + uv__close(stdin_pipe[1]); dup2(stdin_pipe[0], STDIN_FILENO); } if (stdout_pipe[1] >= 0) { - close(stdout_pipe[0]); + uv__close(stdout_pipe[0]); dup2(stdout_pipe[1], STDOUT_FILENO); } if (stderr_pipe[1] >= 0) { - close(stderr_pipe[0]); + uv__close(stderr_pipe[0]); dup2(stderr_pipe[1], STDERR_FILENO); } @@ -2353,7 +2354,7 @@ int uv_spawn(uv_process_t* process, uv_process_options_t options) { if (stdin_pipe[1] >= 0) { assert(options.stdin_stream); assert(stdin_pipe[0] >= 0); - close(stdin_pipe[0]); + uv__close(stdin_pipe[0]); uv__nonblock(stdin_pipe[1], 1); uv__stream_open((uv_stream_t*)options.stdin_stream, stdin_pipe[1]); } @@ -2361,7 +2362,7 @@ int uv_spawn(uv_process_t* process, uv_process_options_t options) { if (stdout_pipe[0] >= 0) { assert(options.stdout_stream); assert(stdout_pipe[1] >= 0); - close(stdout_pipe[1]); + uv__close(stdout_pipe[1]); uv__nonblock(stdout_pipe[0], 1); uv__stream_open((uv_stream_t*)options.stdout_stream, stdout_pipe[0]); } @@ -2369,7 +2370,7 @@ int uv_spawn(uv_process_t* process, uv_process_options_t options) { if (stderr_pipe[0] >= 0) { assert(options.stderr_stream); assert(stderr_pipe[1] >= 0); - close(stderr_pipe[1]); + uv__close(stderr_pipe[1]); uv__nonblock(stderr_pipe[0], 1); uv__stream_open((uv_stream_t*)options.stderr_stream, stderr_pipe[0]); } @@ -2378,12 +2379,12 @@ int uv_spawn(uv_process_t* process, uv_process_options_t options) { error: uv_err_new((uv_handle_t*)process, errno); - close(stdin_pipe[0]); - close(stdin_pipe[1]); - close(stdout_pipe[0]); - close(stdout_pipe[1]); - close(stderr_pipe[0]); - close(stderr_pipe[1]); + uv__close(stdin_pipe[0]); + uv__close(stdin_pipe[1]); + uv__close(stdout_pipe[0]); + uv__close(stdout_pipe[1]); + uv__close(stderr_pipe[0]); + uv__close(stderr_pipe[1]); return -1; } diff --git a/deps/uv/test/run-tests.c b/deps/uv/test/run-tests.c index a22f62066b1..8c80d34bed1 100644 --- a/deps/uv/test/run-tests.c +++ b/deps/uv/test/run-tests.c @@ -52,8 +52,9 @@ int main(int argc, char **argv) { } if (strcmp(argv[1], "spawn_helper3") == 0) { - gets(buffer); - printf(buffer); + fgets(buffer, sizeof(buffer) - 1, stdin); + buffer[sizeof(buffer) - 1] = '\0'; + fputs(buffer, stdout); return 1; } |