Skip to content
This repository was archived by the owner on Jun 15, 2023. It is now read-only.

Commit 82a68c9

Browse files
committed
Only run SubprocessTest.SetWithLots on FreeBSD when ppoll() exists.
Should fix ninja-build#1189 after ninja-build#1185.
1 parent 7cffca2 commit 82a68c9

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

src/subprocess-posix.cc

-7
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,6 @@
2424
#include <sys/wait.h>
2525
#include <spawn.h>
2626

27-
#ifdef __FreeBSD__
28-
# include <sys/param.h>
29-
# if defined USE_PPOLL && __FreeBSD_version < 1002000
30-
# undef USE_PPOLL
31-
# endif
32-
#endif
33-
3427
extern char** environ;
3528

3629
#include "util.h"

src/subprocess.h

+8
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,14 @@ using namespace std;
2626
#include <signal.h>
2727
#endif
2828

29+
// ppoll() exists on FreeBSD, but only on newer versions.
30+
#ifdef __FreeBSD__
31+
# include <sys/param.h>
32+
# if defined USE_PPOLL && __FreeBSD_version < 1002000
33+
# undef USE_PPOLL
34+
# endif
35+
#endif
36+
2937
#include "exit_status.h"
3038

3139
/// Subprocess wraps a single async subprocess. It is entirely

src/subprocess_test.cc

+1-3
Original file line numberDiff line numberDiff line change
@@ -214,9 +214,7 @@ TEST_F(SubprocessTest, SetWithMulti) {
214214
}
215215
}
216216

217-
// OS X's process limit is less than 1025 by default
218-
// (|sysctl kern.maxprocperuid| is 709 on 10.7 and 10.8 and less prior to that).
219-
#if !defined(__APPLE__) && !defined(_WIN32)
217+
#if defined(USE_PPOLL)
220218
TEST_F(SubprocessTest, SetWithLots) {
221219
// Arbitrary big number; needs to be over 1024 to confirm we're no longer
222220
// hostage to pselect.

0 commit comments

Comments
 (0)