Dr. Werner Fink 2010-09-20 13:53:50 +00:00 committed by Git OBS Bridge
parent 19dd243a71
commit c4dc9444c4

20
bug-634840.patch Normal file
View File

@ -0,0 +1,20 @@
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
===================================================================
--- procps-3.2.8/top.c
+++ procps-3.2.8/top.c 2010-09-20 12:26:57.024458172 +0200
@@ -3445,7 +3445,8 @@ int main (int dont_care_argc, char *argv
windows_stage2(); // as bottom slice
// +-------------+
signal(SIGALRM, end_pgm);
- signal(SIGHUP, end_pgm);
+ if (!Batch)
+ signal(SIGHUP, end_pgm);
signal(SIGINT, end_pgm);
signal(SIGPIPE, end_pgm);
signal(SIGQUIT, end_pgm);