diff options
author | Evan Martin <martine@danga.com> | 2011-10-31 22:39:03 (GMT) |
---|---|---|
committer | Evan Martin <martine@danga.com> | 2011-10-31 22:39:53 (GMT) |
commit | bb52198d196ba294908abad00960783456e40f8b (patch) | |
tree | d337b9553256648609fbecde918342e654aa2543 /src/subprocess.cc | |
parent | a6212990930c1ca85488bada1936ce41aac34364 (diff) | |
download | Ninja-bb52198d196ba294908abad00960783456e40f8b.zip Ninja-bb52198d196ba294908abad00960783456e40f8b.tar.gz Ninja-bb52198d196ba294908abad00960783456e40f8b.tar.bz2 |
don't leak fds into subprocesses
Patch from Antoine Labour <piman@chromium.org>, (hacky) test by me.
Diffstat (limited to 'src/subprocess.cc')
-rw-r--r-- | src/subprocess.cc | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/subprocess.cc b/src/subprocess.cc index 4426da0..65322a6 100644 --- a/src/subprocess.cc +++ b/src/subprocess.cc @@ -42,6 +42,7 @@ bool Subprocess::Start(SubprocessSet* set, const string& command) { if (pipe(output_pipe) < 0) Fatal("pipe: %s", strerror(errno)); fd_ = output_pipe[0]; + SetCloseOnExec(fd_); pid_ = fork(); if (pid_ < 0) |