diff options
author | Nico Weber <nicolasweber@gmx.de> | 2016-11-07 18:22:53 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-07 18:22:53 (GMT) |
commit | 4f759e96677c18fd68b5be9ead1c63c596a70e1a (patch) | |
tree | e5031e7d052828864a6b1a0cd904165ebab07164 | |
parent | 7cffca297227edde0e79c2d4357719c6e345b291 (diff) | |
parent | 82a68c96f4b02b68a41d8ad5d0acac86acba4e32 (diff) | |
download | Ninja-4f759e96677c18fd68b5be9ead1c63c596a70e1a.zip Ninja-4f759e96677c18fd68b5be9ead1c63c596a70e1a.tar.gz Ninja-4f759e96677c18fd68b5be9ead1c63c596a70e1a.tar.bz2 |
Merge pull request #1202 from nico/ppollbsd
Only run SubprocessTest.SetWithLots on FreeBSD when ppoll() exists.
-rw-r--r-- | src/subprocess-posix.cc | 7 | ||||
-rw-r--r-- | src/subprocess.h | 8 | ||||
-rw-r--r-- | src/subprocess_test.cc | 4 |
3 files changed, 9 insertions, 10 deletions
diff --git a/src/subprocess-posix.cc b/src/subprocess-posix.cc index 3c81b7f..5ffe85b 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" diff --git a/src/subprocess.h b/src/subprocess.h index 51f40b2..b2d486c 100644 --- a/src/subprocess.h +++ b/src/subprocess.h @@ -26,6 +26,14 @@ using namespace std; #include <signal.h> #endif +// ppoll() exists on FreeBSD, but only on newer versions. +#ifdef __FreeBSD__ +# include <sys/param.h> +# if defined USE_PPOLL && __FreeBSD_version < 1002000 +# undef USE_PPOLL +# endif +#endif + #include "exit_status.h" /// Subprocess wraps a single async subprocess. It is entirely diff --git a/src/subprocess_test.cc b/src/subprocess_test.cc index ee16190..0a8c206 100644 --- a/src/subprocess_test.cc +++ b/src/subprocess_test.cc @@ -214,9 +214,7 @@ TEST_F(SubprocessTest, SetWithMulti) { } } -// OS X's process limit is less than 1025 by default -// (|sysctl kern.maxprocperuid| is 709 on 10.7 and 10.8 and less prior to that). -#if !defined(__APPLE__) && !defined(_WIN32) +#if defined(USE_PPOLL) TEST_F(SubprocessTest, SetWithLots) { // Arbitrary big number; needs to be over 1024 to confirm we're no longer // hostage to pselect. |