|
|
beb32c |
diff -up ./ps/display.c.ori ./ps/display.c
|
|
|
beb32c |
--- ./ps/display.c.ori 2021-02-09 11:11:25.000000000 +0100
|
|
|
beb32c |
+++ ./ps/display.c 2022-11-29 18:39:13.254573784 +0100
|
|
|
beb32c |
@@ -44,6 +44,8 @@
|
|
|
beb32c |
#define SIGCHLD SIGCLD
|
|
|
beb32c |
#endif
|
|
|
beb32c |
|
|
|
beb32c |
+#define SIG_IS_TERM_OR_HUP(signo) (((signo) == SIGTERM) || (signo) == SIGHUP)
|
|
|
beb32c |
+
|
|
|
beb32c |
char *myname;
|
|
|
beb32c |
|
|
|
beb32c |
/* just reports a crash */
|
|
|
beb32c |
@@ -54,20 +56,23 @@ static void signal_handler(int signo){
|
|
|
beb32c |
sigprocmask(SIG_BLOCK, &ss, NULL);
|
|
|
beb32c |
if(signo==SIGPIPE) _exit(0); /* "ps | head" will cause this */
|
|
|
beb32c |
/* fprintf() is not reentrant, but we _exit() anyway */
|
|
|
beb32c |
- fprintf(stderr,
|
|
|
beb32c |
- _("Signal %d (%s) caught by %s (%s).\n"),
|
|
|
beb32c |
- signo,
|
|
|
beb32c |
- signal_number_to_name(signo),
|
|
|
beb32c |
- myname,
|
|
|
beb32c |
- PACKAGE_VERSION
|
|
|
beb32c |
- );
|
|
|
beb32c |
+ if (!SIG_IS_TERM_OR_HUP(signo)) {
|
|
|
beb32c |
+ fprintf(stderr,
|
|
|
beb32c |
+ _("Signal %d (%s) caught by %s (%s).\n"),
|
|
|
beb32c |
+ signo,
|
|
|
beb32c |
+ signal_number_to_name(signo),
|
|
|
beb32c |
+ myname,
|
|
|
beb32c |
+ PACKAGE_VERSION
|
|
|
beb32c |
+ );
|
|
|
beb32c |
+ }
|
|
|
beb32c |
switch (signo) {
|
|
|
beb32c |
case SIGHUP:
|
|
|
beb32c |
case SIGUSR1:
|
|
|
beb32c |
case SIGUSR2:
|
|
|
beb32c |
exit(EXIT_FAILURE);
|
|
|
beb32c |
default:
|
|
|
beb32c |
- error_at_line(0, 0, __FILE__, __LINE__, "%s", _("please report this bug"));
|
|
|
beb32c |
+ if (!SIG_IS_TERM_OR_HUP(signo))
|
|
|
beb32c |
+ error_at_line(0, 0, __FILE__, __LINE__, "%s", _("please report this bug"));
|
|
|
beb32c |
signal(signo, SIG_DFL); /* allow core file creation */
|
|
|
beb32c |
sigemptyset(&ss);
|
|
|
beb32c |
sigaddset(&ss, signo);
|