commit 9dc0873e0329db6f09445f86f472a6141ae82a9e
parent 49cfbe507389281b72b191e29d87a59ee12db363
Author: sin <sin@2f30.org>
Date: Sat, 8 Nov 2014 22:30:30 +0000
Treat POLLHUP as error
Diffstat:
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/xbattmon.c b/xbattmon.c
@@ -210,10 +210,8 @@ again:
redraw();
continue;
}
- if ((pfd[0].revents & (POLLERR | POLLNVAL)) != 0)
+ if ((pfd[0].revents & (POLLERR | POLLHUP | POLLNVAL)) != 0)
errx(1, "bad fd: %d", pfd[0].fd);
- if ((pfd[0].revents & (POLLIN | POLLHUP)) == 0)
- continue;
while (XCheckIfEvent(dpy, &ev, evpredicate, NULL) == True) {
switch (ev.type) {
case Expose: