Fix missing POLLRDHUP constant on older systems.
authorTed Vessenes <tvessene@akamai.com>
Wed, 11 Jul 2012 14:49:16 +0000 (10:49 -0400)
committerTed Vessenes <tvessene@akamai.com>
Wed, 11 Jul 2012 14:56:38 +0000 (10:56 -0400)
Attempting to compile with g++ 4.1.2 failed because the POLLRDHUP
constant was not defined when <poll.h> is included.

src/subprocess.cc

index 0d240b1..fee842f 100644 (file)
 #include <string.h>
 #include <sys/wait.h>
 
+// Older versions of won't find this in <poll.h>.  Some versions keep 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) {