summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2004-05-07 19:19:50 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2004-05-07 19:19:50 +0000
commit9f012d5c62dac0a26a2ab86512f0b5d920b444fd (patch)
tree328145842923b51df13b66bd262c121701dae62d /usr.bin
parent803d89c90099d562082b1baaf27f2412aad700ac (diff)
Check poll revents for error.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/top/top.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/top/top.c b/usr.bin/top/top.c
index 5fc68516e1c..51e44a00dea 100644
--- a/usr.bin/top/top.c
+++ b/usr.bin/top/top.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: top.c,v 1.30 2003/11/01 20:20:57 deraadt Exp $ */
+/* $OpenBSD: top.c,v 1.31 2004/05/07 19:19:49 millert Exp $ */
/*
* Top users/processes display for Unix
@@ -561,7 +561,8 @@ rundisplay(void)
* wait for either input or the end
* of the delay period
*/
- if (poll(pfd, 1, delay * 1000) > 0) {
+ if (poll(pfd, 1, delay * 1000) > 0 &&
+ !(pfd[0].revents & (POLLERR|POLLHUP|POLLNVAL))) {
char *errmsg;
ssize_t len;
int newval;