| diff -up bash-4.1/sig.h.signal bash-4.1/sig.h |
| |
| |
| @@ -96,6 +96,8 @@ do { \ |
| sigprocmask (SIG_BLOCK, &nvar, &ovar); \ |
| } while (0) |
| |
| +#define UNBLOCK_SIGNAL(ovar) sigprocmask (SIG_SETMASK, &ovar, (sigset_t *)NULL) |
| + |
| #if defined (HAVE_POSIX_SIGNALS) |
| # define BLOCK_CHILD(nvar, ovar) \ |
| BLOCK_SIGNAL (SIGCHLD, nvar, ovar) |
| diff -up bash-4.1/trap.c.signal bash-4.1/trap.c |
| |
| |
| @@ -516,6 +516,8 @@ set_signal (sig, string) |
| int sig; |
| char *string; |
| { |
| + sigset_t set, oset; |
| + |
| if (SPECIAL_TRAP (sig)) |
| { |
| change_signal (sig, savestring (string)); |
| @@ -546,9 +548,10 @@ set_signal (sig, string) |
| environment in which it is safe to do so. */ |
| if ((sigmodes[sig] & SIG_NO_TRAP) == 0) |
| { |
| - set_signal_handler (sig, SIG_IGN); |
| + BLOCK_SIGNAL (sig, set, oset); |
| change_signal (sig, savestring (string)); |
| set_signal_handler (sig, trap_handler); |
| + UNBLOCK_SIGNAL (oset); |
| } |
| else |
| change_signal (sig, savestring (string)); |