Blame SOURCES/procps-ng-3.3.10-top-segv-on-double-exit.patch
|
|
6909f1 |
diff -up ./top/top.c.ori ./top/top.c
|
|
|
6909f1 |
--- ./top/top.c.ori 2019-08-08 17:07:57.970295504 +0200
|
|
|
6909f1 |
+++ ./top/top.c 2019-08-08 17:09:02.705070742 +0200
|
|
|
6909f1 |
@@ -406,6 +406,11 @@ static void at_eoj (void) {
|
|
|
6909f1 |
* The real program end */
|
|
|
6909f1 |
static void bye_bye (const char *str) NORETURN;
|
|
|
6909f1 |
static void bye_bye (const char *str) {
|
|
|
6909f1 |
+ sigset_t ss;
|
|
|
6909f1 |
+
|
|
|
6909f1 |
+// POSIX.1-2004 async-signal-safe: sigfillset, sigprocmask
|
|
|
6909f1 |
+ sigfillset(&ss);
|
|
|
6909f1 |
+ sigprocmask(SIG_BLOCK, &ss, NULL);
|
|
|
6909f1 |
at_eoj(); // restore tty in preparation for exit
|
|
|
6909f1 |
#ifdef ATEOJ_RPTSTD
|
|
|
6909f1 |
{ proc_t *p;
|
|
|
6909f1 |
@@ -616,12 +621,6 @@ static void sig_abexit (int sig) {
|
|
|
6909f1 |
* SIGUSR1 and SIGUSR2 */
|
|
|
6909f1 |
static void sig_endpgm (int dont_care_sig) NORETURN;
|
|
|
6909f1 |
static void sig_endpgm (int dont_care_sig) {
|
|
|
6909f1 |
- sigset_t ss;
|
|
|
6909f1 |
-
|
|
|
6909f1 |
-// POSIX.1-2004 async-signal-safe: sigfillset, sigprocmask
|
|
|
6909f1 |
- sigfillset(&ss);
|
|
|
6909f1 |
- sigprocmask(SIG_BLOCK, &ss, NULL);
|
|
|
6909f1 |
- Frames_signal = BREAK_sig;
|
|
|
6909f1 |
bye_bye(NULL);
|
|
|
6909f1 |
(void)dont_care_sig;
|
|
|
6909f1 |
} // end: sig_endpgm
|