summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2016-11-07 10:17:08 -0800
committerNico Weber <nicolasweber@gmx.de>2016-11-07 10:17:08 -0800
commit82a68c96f4b02b68a41d8ad5d0acac86acba4e32 (patch)
treee5031e7d052828864a6b1a0cd904165ebab07164
parent7cffca297227edde0e79c2d4357719c6e345b291 (diff)
downloadninja-82a68c96f4b02b68a41d8ad5d0acac86acba4e32.tar.gz
Only run SubprocessTest.SetWithLots on FreeBSD when ppoll() exists.
Should fix #1189 after #1185.
-rw-r--r--src/subprocess-posix.cc7
-rw-r--r--src/subprocess.h8
-rw-r--r--src/subprocess_test.cc4
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.