From 6f679a4ff7bd332eb601e11a7d815311e22612c5 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Fri, 11 Jan 2013 12:57:04 +0100 Subject: [PATCH] unix: don't swap stdin file descriptors Bug introduced in 47f496a. It turns out the file descriptors of the stdin pipe don't have to be swapped around. --- src/unix/process.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/unix/process.c b/src/unix/process.c index 9a765c9a..a23f5835 100644 --- a/src/unix/process.c +++ b/src/unix/process.c @@ -391,14 +391,6 @@ int uv_spawn(uv_loop_t* loop, if (uv__process_init_stdio(options.stdio + i, pipes[i])) goto error; - /* swap stdin file descriptors, it's the only writable stream */ - { - int* p = pipes[0]; - int t = p[0]; - p[0] = p[1]; - p[1] = t; - } - /* This pipe is used by the parent to wait until * the child has called `execve()`. We need this * to avoid the following race condition: