From 1988f5e581e4cadb20d8e69ddee9be8a26ff2646 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Wed, 12 Sep 2012 01:44:46 +0200 Subject: [PATCH] unix: put child process stdio fds in blocking mode Remove the O_NONBLOCK flag from file descriptors 0-2, most applications don't expect EAGAIN errors when dealing with stdio. --- src/unix/process.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/unix/process.c b/src/unix/process.c index a0eb01ad..40330640 100644 --- a/src/unix/process.c +++ b/src/unix/process.c @@ -240,6 +240,9 @@ static void uv__process_child_init(uv_process_options_t options, } else { uv__cloexec(use_fd, 0); } + + if (fd <= 2) + uv__nonblock(fd, 0); } if (options.cwd && chdir(options.cwd)) {