rcolebaugh / rpms / bash

Forked from rpms/bash a year ago
Clone

Blame SOURCES/bash-4.2-signal.patch

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