]> git.ipfire.org Git - thirdparty/bash.git/commitdiff
SIGINT trap handler SIGINT loop fix
authorChet Ramey <chet.ramey@case.edu>
Fri, 1 Jun 2018 14:20:32 +0000 (10:20 -0400)
committerChet Ramey <chet.ramey@case.edu>
Fri, 1 Jun 2018 14:20:32 +0000 (10:20 -0400)
jobs.c
patchlevel.h

diff --git a/jobs.c b/jobs.c
index 2684632df99cafbd6f41170345358b78c7762eff..5ee21e1031e58cf464c2594ba727bc8fdc6ce133 100644 (file)
--- a/jobs.c
+++ b/jobs.c
@@ -2689,7 +2689,17 @@ wait_for (pid)
   wait_sigint_received = child_caught_sigint = 0;
   if (job_control == 0 || (subshell_environment&SUBSHELL_COMSUB))
     {
-      old_sigint_handler = set_signal_handler (SIGINT, wait_sigint_handler);
+      SigHandler *temp_sigint_handler;
+
+      temp_sigint_handler = set_signal_handler (SIGINT, wait_sigint_handler);
+      if (temp_sigint_handler == wait_sigint_handler)
+        {
+#if defined (DEBUG)
+         internal_warning ("wait_for: recursively setting old_sigint_handler to wait_sigint_handler: running_trap = %d", running_trap);
+#endif
+        }
+      else
+       old_sigint_handler = temp_sigint_handler;
       waiting_for_child = 0;
       if (old_sigint_handler == SIG_IGN)
        set_signal_handler (SIGINT, old_sigint_handler);
index 4a65dc0ff02b0f07eac616d727e6db973d330360..d87b0ba71158573e8b793d5c08b4704dba048414 100644 (file)
@@ -25,6 +25,6 @@
    regexp `^#define[   ]*PATCHLEVEL', since that's what support/mkversion.sh
    looks for to find the patch level (for the sccs version string). */
 
-#define PATCHLEVEL 20
+#define PATCHLEVEL 21
 
 #endif /* _PATCHLEVEL_H_ */