]> granicus.if.org Git - procps-ng/commit
top: ignore the SIGHUP signal if running in batch mode
authorJim Warner <james.warner@comcast.net>
Sat, 9 Apr 2022 05:00:00 +0000 (00:00 -0500)
committerCraig Small <csmall@dropbear.xyz>
Mon, 11 Apr 2022 06:41:12 +0000 (16:41 +1000)
commit6aec3ec93ac9e7cbcf75d9ec9b9b45e71cda5ac5
tree0778cc1f2df739daf420e6bb35cb60514c89c31c
parent7597aaf7f9f92899f3a0ad05461d42eeace0c581
top: ignore the SIGHUP signal if running in batch mode

It would appear that openSUSE was the first to release
procps-ng version 4.0.0 (in the tumbleweed distro). As
a result I checked their source rpm and found a couple
of patches I'm porting to newlib for the next release.

This particulate commit was a refactor of the openSUSE
patch 'procps-ng-3.3.8-bnc634840.patch'. Unfortunately
their original patch did not have the intended effect.

That was because the amended signal handling logic was
performed well before the command line parameters were
parsed. So the global 'Batch' flag was in its 0 state.

. what follows is the original openSUSE commit message
------------------------------------------------------
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.
------------------------------------------------------

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