Blame SOURCES/procps-ng-3.3.15-display-sig-unsafe.patch
|
|
126879 |
diff -up ./ps/display.c.ori ./ps/display.c
|
|
|
126879 |
--- ./ps/display.c.ori 2018-05-18 23:32:21.998979977 +0200
|
|
|
126879 |
+++ ./ps/display.c 2022-11-24 15:11:26.678314866 +0100
|
|
|
126879 |
@@ -44,26 +44,31 @@
|
|
|
126879 |
#define SIGCHLD SIGCLD
|
|
|
126879 |
#endif
|
|
|
126879 |
|
|
|
126879 |
+#define SIG_IS_TERM_OR_HUP(signo) (((signo) == SIGTERM) || (signo) == SIGHUP)
|
|
|
126879 |
+
|
|
|
126879 |
char *myname;
|
|
|
126879 |
|
|
|
126879 |
/* just reports a crash */
|
|
|
126879 |
static void signal_handler(int signo){
|
|
|
126879 |
if(signo==SIGPIPE) _exit(0); /* "ps | head" will cause this */
|
|
|
126879 |
/* fprintf() is not reentrant, but we _exit() anyway */
|
|
|
126879 |
- fprintf(stderr,
|
|
|
126879 |
- _("Signal %d (%s) caught by %s (%s).\n"),
|
|
|
126879 |
- signo,
|
|
|
126879 |
- signal_number_to_name(signo),
|
|
|
126879 |
- myname,
|
|
|
126879 |
- PACKAGE_VERSION
|
|
|
126879 |
- );
|
|
|
126879 |
+ if (!SIG_IS_TERM_OR_HUP(signo)) {
|
|
|
126879 |
+ fprintf(stderr,
|
|
|
126879 |
+ _("Signal %d (%s) caught by %s (%s).\n"),
|
|
|
126879 |
+ signo,
|
|
|
126879 |
+ signal_number_to_name(signo),
|
|
|
126879 |
+ myname,
|
|
|
126879 |
+ PACKAGE_VERSION
|
|
|
126879 |
+ );
|
|
|
126879 |
+ }
|
|
|
126879 |
switch (signo) {
|
|
|
126879 |
case SIGHUP:
|
|
|
126879 |
case SIGUSR1:
|
|
|
126879 |
case SIGUSR2:
|
|
|
126879 |
exit(EXIT_FAILURE);
|
|
|
126879 |
default:
|
|
|
126879 |
- error_at_line(0, 0, __FILE__, __LINE__, "%s", _("please report this bug"));
|
|
|
126879 |
+ if (!SIG_IS_TERM_OR_HUP(signo))
|
|
|
126879 |
+ error_at_line(0, 0, __FILE__, __LINE__, "%s", _("please report this bug"));
|
|
|
126879 |
signal(signo, SIG_DFL); /* allow core file creation */
|
|
|
126879 |
kill(getpid(), signo);
|
|
|
126879 |
_exit(EXIT_FAILURE);
|