top: do not catch SIGHUP, when operating in batch mode
authorJim Warner <james.warner@comcast.net>
Tue, 18 Dec 2012 06:00:00 +0000 (00:00 -0600)
committerCraig Small <csmall@enc.com.au>
Sat, 22 Dec 2012 06:10:11 +0000 (17:10 +1100)
commit9f4e72b208bad8e2cb1314cf485d3854a574ebec
tree1c2b0daba13663460cc5c63926ba11299f957941
parentced5009f759327011488d3c5d0bd3192ff8da009
top: do not catch SIGHUP, when operating in batch mode

This commit was adapted from the openSUSE patch, whose
original comments appear between the --- marker below.

It should be noted, however, that the original changes
were ineffective (wasted) because 'Batch' mode had not
yet been set when signals were being checked and their
handlers established. Thus, SIGHUP was never bypassed.

(of course, only our comments are perfectly justified)

------------------------------------------------------
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.
------------------------------------------------------

Reference(s):
http://www.freelists.org/post/procps/top-enhancements-i-hope,1

Signed-off-by: Jim Warner <james.warner@comcast.net>
top/top.c