summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Cristau <jcristau@debian.org>2010-02-02 14:45:17 +0100
committerJulien Cristau <jcristau@debian.org>2010-02-05 20:16:10 +0100
commitb7af1cef38d1995289acd1f2c13580b378ec0fc9 (patch)
tree01276b80e3afee66bdc5e1a35648b933a37657d3
parent3fb0af21816b9f89c4b33e7cac5aad6d90bcc6c7 (diff)
poll: check for POLLERR|POLLHUP in WaitForInput
X.Org bug#26383 <http://bugs.freedesktop.org/26383> Acked-by: Juliusz Chroboczek <jch@pps.jussieu.fr> Signed-off-by: Julien Cristau <jcristau@debian.org>
-rw-r--r--sys.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys.c b/sys.c
index 0a50103..e22b69d 100644
--- a/sys.c
+++ b/sys.c
@@ -102,9 +102,9 @@ waitForInput(int fd1, int fd2)
return -1;
ret = 0;
- if(pfd[0].revents & POLLIN)
+ if(pfd[0].revents & (POLLIN | POLLERR | POLLHUP))
ret |= 1;
- if(pfd[1].revents & POLLIN)
+ if(pfd[1].revents & (POLLIN | POLLERR | POLLHUP))
ret |= 2;
return ret;
}