rcolebaugh / rpms / bash

Forked from rpms/bash a year ago
Clone

Blame SOURCES/bash-4.2-signal.patch

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