summaryrefslogtreecommitdiffstats
path: root/src/subprocess-posix.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/subprocess-posix.cc')
-rw-r--r--src/subprocess-posix.cc12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/subprocess-posix.cc b/src/subprocess-posix.cc
index 3c81b7f..f1f94e5 100644
--- a/src/subprocess-posix.cc
+++ b/src/subprocess-posix.cc
@@ -24,13 +24,6 @@
#include <sys/wait.h>
#include <spawn.h>
-#ifdef __FreeBSD__
-# include <sys/param.h>
-# if defined USE_PPOLL && __FreeBSD_version < 1002000
-# undef USE_PPOLL
-# endif
-#endif
-
extern char** environ;
#include "util.h"
@@ -80,8 +73,6 @@ bool Subprocess::Start(SubprocessSet* set, const string& command) {
// default action in the new process image, so no explicit
// POSIX_SPAWN_SETSIGDEF parameter is needed.
- // TODO: Consider using POSIX_SPAWN_USEVFORK on Linux with glibc?
-
if (!use_console_) {
// Put the child in its own process group, so ctrl-c won't reach it.
flags |= POSIX_SPAWN_SETPGROUP;
@@ -100,6 +91,9 @@ bool Subprocess::Start(SubprocessSet* set, const string& command) {
// In the console case, output_pipe is still inherited by the child and
// closed when the subprocess finishes, which then notifies ninja.
}
+#ifdef POSIX_SPAWN_USEVFORK
+ flags |= POSIX_SPAWN_USEVFORK;
+#endif
if (posix_spawnattr_setflags(&attr, flags) != 0)
Fatal("posix_spawnattr_setflags: %s", strerror(errno));