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