perl/Module-Build-Tiny: update to 0.051 for Perl 5.36 and 5.38
[oi-userland.git] / components / shell / bash / patches / bash52-014.patch
blobc6f3176bfd36226d43ff876bbc956b7e0ab281e1
1 BASH PATCH REPORT
2 =================
4 Bash-Release: 5.2
5 Patch-ID: bash52-014
7 Bug-Reported-by: Andreas Schwab <schwab@suse.de>
8 Bug-Reference-ID: <mvmv8opcbha.fsf@suse.de>
9 Bug-Reference-URL: https://lists.gnu.org/archive/html/bug-bash/2022-10/msg00076.html
11 Bug-Description:
13 Bash defers processing additional terminating signals when running the
14 EXIT trap while exiting due to a terminating signal. This patch allows the
15 new terminating signal to kill the shell immediately.
17 Patch (apply with `patch -p0'):
19 *** ../bash-5.2-patched/execute_cmd.c 2022-11-23 17:09:18.000000000 -0500
20 --- execute_cmd.c 2022-11-28 10:36:08.000000000 -0500
21 ***************
22 *** 3625,3628 ****
23 --- 3649,3653 ----
25 dispose_words (es);
26 + QUIT;
28 if (match)
29 *** ../bash-5.2-patched/sig.c 2021-11-04 14:15:31.000000000 -0400
30 --- sig.c 2022-12-06 09:45:11.000000000 -0500
31 ***************
32 *** 95,98 ****
33 --- 95,99 ----
35 static void initialize_shell_signals PARAMS((void));
36 + static void kill_shell PARAMS((int));
38 void
39 ***************
40 *** 487,490 ****
41 --- 495,500 ----
44 + static int handling_termsig = 0;
46 sighandler
47 termsig_sighandler (sig)
48 ***************
49 *** 533,536 ****
50 --- 543,554 ----
51 terminate_immediately = 1;
53 + /* If we are currently handling a terminating signal, we have a couple of
54 + choices here. We can ignore this second terminating signal and let the
55 + shell exit from the first one, or we can exit immediately by killing
56 + the shell with this signal. This code implements the latter; to implement
57 + the former, replace the kill_shell(sig) with return. */
58 + if (handling_termsig)
59 + kill_shell (sig); /* just short-circuit now */
61 terminating_signal = sig;
63 ***************
64 *** 565,572 ****
65 int sig;
67 - static int handling_termsig = 0;
68 - int i, core;
69 - sigset_t mask;
71 /* Simple semaphore to keep this function from being executed multiple
72 times. Since we no longer are running as a signal handler, we don't
73 --- 585,588 ----
74 ***************
75 *** 574,578 ****
76 if (handling_termsig)
77 return;
78 ! handling_termsig = 1;
79 terminating_signal = 0; /* keep macro from re-testing true. */
81 --- 590,595 ----
82 if (handling_termsig)
83 return;
85 ! handling_termsig = terminating_signal; /* for termsig_sighandler */
86 terminating_signal = 0; /* keep macro from re-testing true. */
88 ***************
89 *** 614,617 ****
90 --- 631,644 ----
91 run_exit_trap (); /* XXX - run exit trap possibly in signal context? */
93 + kill_shell (sig);
94 + }
96 + static void
97 + kill_shell (sig)
98 + int sig;
99 + {
100 + int i, core;
101 + sigset_t mask;
103 /* We don't change the set of blocked signals. If a user starts the shell
104 with a terminating signal blocked, we won't get here (and if by some
105 *** ../bash-5.2/patchlevel.h 2020-06-22 14:51:03.000000000 -0400
106 --- patchlevel.h 2020-10-01 11:01:28.000000000 -0400
107 ***************
108 *** 26,30 ****
109 looks for to find the patch level (for the sccs version string). */
111 ! #define PATCHLEVEL 13
113 #endif /* _PATCHLEVEL_H_ */
114 --- 26,30 ----
115 looks for to find the patch level (for the sccs version string). */
117 ! #define PATCHLEVEL 14
119 #endif /* _PATCHLEVEL_H_ */