20 lines
763 B
Diff
20 lines
763 B
Diff
|
Do not setup SIGHUP signal handler if we are in the batch mode
|
||
|
|
||
|
Top enables a signal handler for the SIGHUP signal (loss of terminal). While
|
||
|
this makes sense for top's default interactive mode, it doesn't make any sense
|
||
|
for batch mode. If you run top in nohup just to collect data over time and
|
||
|
disconnect top finishes which is not what one would expect.
|
||
|
Index: procps-3.2.8/top.c
|
||
|
|
||
|
--- top/top.c
|
||
|
+++ top/top.c 2012-06-04 10:13:48.576010662 +0000
|
||
|
@@ -2147,6 +2147,8 @@ static void before (char *me) {
|
||
|
sigemptyset(&sa.sa_mask);
|
||
|
sa.sa_flags = SA_RESTART;
|
||
|
for (i = SIGRTMAX; i; i--) {
|
||
|
+ if (Batch && i == SIGHUP)
|
||
|
+ continue;
|
||
|
switch (i) {
|
||
|
case SIGALRM: case SIGHUP: case SIGINT:
|
||
|
case SIGPIPE: case SIGQUIT: case SIGTERM:
|