summaryrefslogtreecommitdiffstats
path: root/src/subprocess-posix.cc
diff options
context:
space:
mode:
authorEvan Martin <martine@danga.com>2012-12-21 01:49:55 (GMT)
committerEvan Martin <martine@danga.com>2012-12-21 02:01:41 (GMT)
commitd8d3b2f0bdee4cd3d801bcd19bf65f91fb6760e0 (patch)
tree7b0d4c84cc5577f807387b79dece393e63d90cf3 /src/subprocess-posix.cc
parentbe847b38264adce9a5309c6138e5c94d4785db5a (diff)
downloadNinja-d8d3b2f0bdee4cd3d801bcd19bf65f91fb6760e0.zip
Ninja-d8d3b2f0bdee4cd3d801bcd19bf65f91fb6760e0.tar.gz
Ninja-d8d3b2f0bdee4cd3d801bcd19bf65f91fb6760e0.tar.bz2
correctly open /dev/null in subprocesses
Fixes issue #468.
Diffstat (limited to 'src/subprocess-posix.cc')
-rw-r--r--src/subprocess-posix.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/subprocess-posix.cc b/src/subprocess-posix.cc
index 1c47fd1..8f1a04e 100644
--- a/src/subprocess-posix.cc
+++ b/src/subprocess-posix.cc
@@ -76,7 +76,7 @@ bool Subprocess::Start(SubprocessSet* set, const string& command) {
break;
// Open /dev/null over stdin.
- int devnull = open("/dev/null", O_WRONLY);
+ int devnull = open("/dev/null", O_RDONLY);
if (devnull < 0)
break;
if (dup2(devnull, 0) < 0)