summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNico Weber <thakis@chromium.org>2020-06-21 18:37:46 -0400
committerGitHub <noreply@github.com>2020-06-21 18:37:46 -0400
commitb1914048285d627027ccd5df801c7d43ede0c060 (patch)
tree8a2523e887fc0f88edd331c1b00e2e01577f0ad6
parent8948ec2de60249deb756e02cf3c742f62f12aafe (diff)
downloadninja-b1914048285d627027ccd5df801c7d43ede0c060.tar.gz
Include sys/select.h in subprocess-posix.cc
pselect() is in sys/select.h in "newer" (2001) versions of posix, so add an include for it. While here, only include poll.h if USE_PPOLL is defined.
-rw-r--r--src/subprocess-posix.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/subprocess-posix.cc b/src/subprocess-posix.cc
index fc5543e..74785d1 100644
--- a/src/subprocess-posix.cc
+++ b/src/subprocess-posix.cc
@@ -18,13 +18,18 @@
#include <assert.h>
#include <errno.h>
#include <fcntl.h>
-#include <poll.h>
#include <unistd.h>
#include <stdio.h>
#include <string.h>
#include <sys/wait.h>
#include <spawn.h>
+#if defined(USE_PPOLL)
+#include <poll.h>
+#else
+#include <sys/select.h>
+#endif
+
extern char** environ;
#include "util.h"