diff options
| author | Jaakko Heinonen <jh@FreeBSD.org> | 2009-11-15 14:11:26 +0000 |
|---|---|---|
| committer | Jaakko Heinonen <jh@FreeBSD.org> | 2009-11-15 14:11:26 +0000 |
| commit | f969a7ac4b105b989d9edcef83cc28677e186a92 (patch) | |
| tree | 7ad85c480f6ba19e6869944861cd3b645d4c4755 /usr.bin | |
| parent | 5b7c45037d6a776ea44e88fb986f3248c66b93b0 (diff) | |
Notes
Diffstat (limited to 'usr.bin')
| -rw-r--r-- | usr.bin/systat/keyboard.c | 11 | ||||
| -rw-r--r-- | usr.bin/systat/main.c | 1 |
2 files changed, 8 insertions, 4 deletions
diff --git a/usr.bin/systat/keyboard.c b/usr.bin/systat/keyboard.c index 7784f5be98a3..0ab28eb2603e 100644 --- a/usr.bin/systat/keyboard.c +++ b/usr.bin/systat/keyboard.c @@ -39,8 +39,10 @@ __FBSDID("$FreeBSD$"); static const char sccsid[] = "@(#)keyboard.c 8.1 (Berkeley) 6/6/93"; #endif +#include <errno.h> #include <ctype.h> #include <signal.h> +#include <stdlib.h> #include <termios.h> #include "systat.h" @@ -57,10 +59,11 @@ keyboard(void) move(CMDLINE, 0); do { refresh(); - ch = getch() & 0177; - if (ch == 0177 && ferror(stdin)) { - clearerr(stdin); - continue; + ch = getch(); + if (ch == ERR) { + if (errno == EINTR) + continue; + exit(1); } if (ch >= 'A' && ch <= 'Z') ch += 'a' - 'A'; diff --git a/usr.bin/systat/main.c b/usr.bin/systat/main.c index 28673e54e6b7..6f6b99406860 100644 --- a/usr.bin/systat/main.c +++ b/usr.bin/systat/main.c @@ -133,6 +133,7 @@ main(int argc, char **argv) exit(1); } } + signal(SIGHUP, die); signal(SIGINT, die); signal(SIGQUIT, die); signal(SIGTERM, die); |
