From 82a68c96f4b02b68a41d8ad5d0acac86acba4e32 Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Mon, 7 Nov 2016 10:17:08 -0800 Subject: Only run SubprocessTest.SetWithLots on FreeBSD when ppoll() exists. Should fix #1189 after #1185. --- src/subprocess-posix.cc | 7 ------- src/subprocess.h | 8 ++++++++ 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 #include -#ifdef __FreeBSD__ -# include -# 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 #endif +// ppoll() exists on FreeBSD, but only on newer versions. +#ifdef __FreeBSD__ +# include +# 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. -- cgit v0.12