diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2001-09-05 06:25:40 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2001-09-05 06:25:40 +0000 |
commit | ab56f2cb25f6a09e5571ab12fc5030139a63ff23 (patch) | |
tree | a563759ac9f61fb0fe3a8be3f231916362c9d948 /usr.bin/top | |
parent | 32b4ecbef87e47bd917da4c10c38a0476c368f86 (diff) |
select correctly, and on the right file descriptors too!
Diffstat (limited to 'usr.bin/top')
-rw-r--r-- | usr.bin/top/top.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.bin/top/top.c b/usr.bin/top/top.c index 04f82233d6b..11ae328becc 100644 --- a/usr.bin/top/top.c +++ b/usr.bin/top/top.c @@ -1,4 +1,4 @@ -/* $OpenBSD: top.c,v 1.10 2001/09/04 23:35:59 millert Exp $ */ +/* $OpenBSD: top.c,v 1.11 2001/09/05 06:25:39 deraadt Exp $ */ const char copyright[] = "Copyright (c) 1984 through 1996, William LeFebvre"; @@ -609,7 +609,7 @@ restart: /* set up arguments for select with timeout */ FD_ZERO(&readfds); - FD_SET(1, &readfds); /* for standard input */ + FD_SET(STDIN_FILENO, &readfds); /* for standard input */ timeout.tv_sec = delay; timeout.tv_usec = 0; @@ -658,7 +658,8 @@ restart: } /* wait for either input or the end of the delay period */ - if (select(32, &readfds, (fd_set *)NULL, (fd_set *)NULL, &timeout) > 0) + if (select(STDIN_FILENO + 1, &readfds, (fd_set *)NULL, + (fd_set *)NULL, &timeout) > 0) { int newval; char *errmsg; |