Blame SOURCES/procps-ng-3.3.10-top-segv-on-double-exit.patch

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