diff options
author | Tobias Hieta <tobias@plexapp.com> | 2013-05-23 13:12:53 (GMT) |
---|---|---|
committer | Tobias Hieta <tobias@plexapp.com> | 2013-05-23 13:12:53 (GMT) |
commit | 4db8e5ddf0c941616842d2a6e947477145f84783 (patch) | |
tree | 14ec736f29c8565cd2218ea48f40cb1b35d73f0e /src/subprocess-posix.cc | |
parent | 082d0bebf627331d618ec712f1aa131f76a3722a (diff) | |
download | Ninja-4db8e5ddf0c941616842d2a6e947477145f84783.zip Ninja-4db8e5ddf0c941616842d2a6e947477145f84783.tar.gz Ninja-4db8e5ddf0c941616842d2a6e947477145f84783.tar.bz2 |
Added bootstrap/configure option to force pselect
All modern Linux kernels have ppoll() but sometimes
you might want to compile on something ancient.
This patch adds the possibility to force the use
of pselect() instead by passing --force-pselect
to bootstrap/configure.
The use of ppoll() is still default for Linux
and OpenBSD
Diffstat (limited to 'src/subprocess-posix.cc')
-rw-r--r-- | src/subprocess-posix.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/subprocess-posix.cc b/src/subprocess-posix.cc index 339edfe..b396f84 100644 --- a/src/subprocess-posix.cc +++ b/src/subprocess-posix.cc @@ -40,12 +40,12 @@ bool Subprocess::Start(SubprocessSet* set, const string& command) { if (pipe(output_pipe) < 0) Fatal("pipe: %s", strerror(errno)); fd_ = output_pipe[0]; -#if !defined(linux) && !defined(__OpenBSD__) +#if !defined(USE_PPOLL) // On Linux and OpenBSD, we use ppoll in DoWork(); elsewhere we use pselect // and so must avoid overly-large FDs. if (fd_ >= static_cast<int>(FD_SETSIZE)) Fatal("pipe: %s", strerror(EMFILE)); -#endif // !linux && !__OpenBSD__ +#endif // !USE_PPOLL SetCloseOnExec(fd_); pid_ = fork(); @@ -178,7 +178,7 @@ Subprocess *SubprocessSet::Add(const string& command) { return subprocess; } -#if defined(linux) || defined(__OpenBSD__) +#ifdef USE_PPOLL bool SubprocessSet::DoWork() { vector<pollfd> fds; nfds_t nfds = 0; |