top: follow ps lead, treat SIGUSR1/SIGUSR2 as harmless

Reference(s):
commit f62fd63d9e
http://www.freelists.org/post/procps/PATCH-procps-states-a-bug-is-hit-when-receiving-a-signal-871824

Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
Jim Warner 2012-12-12 00:00:00 -06:00 committed by Craig Small
parent 015e95dec3
commit 7a7e402563

View File

@ -547,7 +547,8 @@ static void sig_abexit (int sig) {
/*
* Catches:
* SIGALRM, SIGHUP, SIGINT, SIGPIPE, SIGQUIT and SIGTERM */
* SIGALRM, SIGHUP, SIGINT, SIGPIPE, SIGQUIT, SIGTERM,
* SIGUSR1 and SIGUSR2 */
static void sig_endpgm (int dont_care_sig) NORETURN;
static void sig_endpgm (int dont_care_sig) {
sigset_t ss;
@ -2865,6 +2866,7 @@ static void before (char *me) {
switch (i) {
case SIGALRM: case SIGHUP: case SIGINT:
case SIGPIPE: case SIGQUIT: case SIGTERM:
case SIGUSR1: case SIGUSR2:
sa.sa_handler = sig_endpgm;
break;
case SIGTSTP: case SIGTTIN: case SIGTTOU: