diff options
Diffstat (limited to 'usr.bin/top/top.c')
-rw-r--r-- | usr.bin/top/top.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/usr.bin/top/top.c b/usr.bin/top/top.c index 39db4594a3b..3ebe661bba1 100644 --- a/usr.bin/top/top.c +++ b/usr.bin/top/top.c @@ -1,4 +1,4 @@ -/* $OpenBSD: top.c,v 1.41 2005/12/04 23:10:06 tedu Exp $ */ +/* $OpenBSD: top.c,v 1.42 2006/03/04 06:54:18 otto Exp $ */ /* * Top users/processes display for Unix @@ -499,6 +499,15 @@ restart: /* wait for the rest of it .... */ pause(); + if (leaveflag) + exit(0); + if (tstopflag) { + (void) signal(SIGTSTP, SIG_DFL); + (void) kill(0, SIGTSTP); + /* reset the signal handler */ + (void) signal(SIGTSTP, tstop); + tstopflag = 0; + } } else { while (no_command) if (rundisplay()) @@ -536,10 +545,8 @@ rundisplay(void) pfd[0].fd = STDIN_FILENO; pfd[0].events = POLLIN; - if (leaveflag) { - end_screen(); - exit(0); - } + if (leaveflag) + quit(0); if (tstopflag) { /* move to the lower left */ end_screen(); |