summaryrefslogtreecommitdiff
path: root/ps
diff options
context:
space:
mode:
authorQualys Security Advisory <qsa@qualys.com>1970-01-01 00:00:00 +0000
committerCraig Small <csmall@enc.com.au>2018-06-09 21:45:38 +1000
commit7bd4f0b6d7e058197ccf4234f2a0bcc17550d0a6 (patch)
tree2f47513018ab23967fb776e8d7d3fa2b0b912c7e /ps
parent6f7d610621ec3841a73230270b0ddbfe0e3a5d16 (diff)
downloadprocps-ng-7bd4f0b6d7e058197ccf4234f2a0bcc17550d0a6.tar.gz
0062-ps/display.c: Always exit from signal_handler().
Right now, "we _exit() anyway" is not always true: for example, the default action for SIGURG is to ignore the signal, which means that "kill(getpid(), signo);" does not terminate the process. Call _exit() explicitly, in this case (rather than exit(), because the terminating kill() calls do not call the functions registered with atexit() either).
Diffstat (limited to 'ps')
-rw-r--r--ps/display.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/ps/display.c b/ps/display.c
index 5cfee84..a7eee15 100644
--- a/ps/display.c
+++ b/ps/display.c
@@ -62,6 +62,7 @@ static void signal_handler(int signo){
error_at_line(0, 0, __FILE__, __LINE__, "%s", _("please report this bug"));
signal(signo, SIG_DFL); /* allow core file creation */
kill(getpid(), signo);
+ _exit(EXIT_FAILURE);
}
}