summaryrefslogtreecommitdiffstats
path: root/src/subprocess-posix.cc
diff options
context:
space:
mode:
authorMatthew Dempsky <mdempsky@google.com>2013-05-01 20:05:00 (GMT)
committerMatthew Dempsky <mdempsky@google.com>2013-05-01 20:05:00 (GMT)
commit1fe35cea0153cbd965bc1e4102c87371096051d5 (patch)
tree4096e2fada769895dfec83c9dcecdc0301c0ba3b /src/subprocess-posix.cc
parent65a58e37a7dd48cb336668351d1cab3db0e4d5fe (diff)
downloadNinja-1fe35cea0153cbd965bc1e4102c87371096051d5.zip
Ninja-1fe35cea0153cbd965bc1e4102c87371096051d5.tar.gz
Ninja-1fe35cea0153cbd965bc1e4102c87371096051d5.tar.bz2
Don't poll pipes using POLLRDHUP
POLLRDHUP is Linux-specific, and isn't necessary for polling pipes anyway. Linux and OpenBSD both return POLLHUP if no process has the pipe open for writing.
Diffstat (limited to 'src/subprocess-posix.cc')
-rw-r--r--src/subprocess-posix.cc9
1 files changed, 1 insertions, 8 deletions
diff --git a/src/subprocess-posix.cc b/src/subprocess-posix.cc
index fb6d272..c56d147 100644
--- a/src/subprocess-posix.cc
+++ b/src/subprocess-posix.cc
@@ -25,13 +25,6 @@
#include <string.h>
#include <sys/wait.h>
-// Older versions of glibc (like 2.4) won't find this in <poll.h>. glibc
-// 2.4 keeps it in <asm-generic/poll.h>, though attempting to include that
-// will redefine the pollfd structure.
-#ifndef POLLRDHUP
-#define POLLRDHUP 0x2000
-#endif
-
#include "util.h"
Subprocess::Subprocess() : fd_(-1), pid_(-1) {
@@ -197,7 +190,7 @@ bool SubprocessSet::DoWork() {
int fd = (*i)->fd_;
if (fd < 0)
continue;
- pollfd pfd = { fd, POLLIN | POLLPRI | POLLRDHUP, 0 };
+ pollfd pfd = { fd, POLLIN | POLLPRI, 0 };
fds.push_back(pfd);
++nfds;
}