Blame SOURCES/bash-4.2-signal.patch

462fb2
diff -up bash-4.1/sig.h.signal bash-4.1/sig.h
462fb2
--- bash-4.1/sig.h.signal	2009-01-04 20:32:41.000000000 +0100
462fb2
+++ bash-4.1/sig.h	2012-08-28 11:19:14.920224571 +0200
462fb2
@@ -96,6 +96,8 @@ do { \
462fb2
   sigprocmask (SIG_BLOCK, &nvar, &ovar); \
462fb2
 } while (0)
462fb2
 
462fb2
+#define UNBLOCK_SIGNAL(ovar) sigprocmask (SIG_SETMASK, &ovar, (sigset_t *)NULL)
462fb2
+
462fb2
 #if defined (HAVE_POSIX_SIGNALS)
462fb2
 #  define BLOCK_CHILD(nvar, ovar) \
462fb2
 	BLOCK_SIGNAL (SIGCHLD, nvar, ovar)
462fb2
diff -up bash-4.1/trap.c.signal bash-4.1/trap.c
462fb2
--- bash-4.1/trap.c.signal	2009-10-10 23:21:44.000000000 +0200
462fb2
+++ bash-4.1/trap.c	2012-08-28 10:58:14.746345797 +0200
462fb2
@@ -516,6 +516,8 @@ set_signal (sig, string)
462fb2
      int sig;
462fb2
      char *string;
462fb2
 {
462fb2
+  sigset_t set, oset;
462fb2
+
462fb2
   if (SPECIAL_TRAP (sig))
462fb2
     {
462fb2
       change_signal (sig, savestring (string));
462fb2
@@ -546,9 +548,10 @@ set_signal (sig, string)
462fb2
      environment in which it is safe to do so. */
462fb2
   if ((sigmodes[sig] & SIG_NO_TRAP) == 0)
462fb2
     {
462fb2
-      set_signal_handler (sig, SIG_IGN);
462fb2
+      BLOCK_SIGNAL (sig, set, oset);
462fb2
       change_signal (sig, savestring (string));
462fb2
       set_signal_handler (sig, trap_handler);
462fb2
+      UNBLOCK_SIGNAL (oset);
462fb2
     }
462fb2
   else
462fb2
     change_signal (sig, savestring (string));