代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/bash 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From fe24a6a55e8850298b496c5b9d82f1866eba190e Mon Sep 17 00:00:00 2001
From: Chet Ramey <[email protected]>
Date: Mon, 30 Oct 2023 12:16:07 -0400
Subject: [PATCH] changes to SIGINT handler while waiting for a child; skip
vertical whitespace after translating an integer
Conflict:partial round, only the modified content of jobs.c is rounded.
Reference:https://git.savannah.gnu.org/cgit/bash.git/commit/?id=fe24a6a55e8850298b496c5b9d82f1866eba190e
---
jobs.c | 24 ++++++++++++++++--------
1 file changed, 16 insertions(+), 8 deletions(-)
diff --git a/jobs.c b/jobs.c
index b8373cf5..59c46475 100644
--- a/jobs.c
+++ b/jobs.c
@@ -2664,6 +2664,10 @@ wait_for_background_pids (struct procstat *ps)
#define INVALID_SIGNAL_HANDLER (SigHandler *)wait_for_background_pids
static SigHandler *old_sigint_handler = INVALID_SIGNAL_HANDLER;
+/* The current SIGINT handler as set by restore_sigint_handler. Only valid
+ immediately after restore_sigint_handler, used for continuations. */
+static SigHandler *cur_sigint_handler = INVALID_SIGNAL_HANDLER;
+
static int wait_sigint_received;
static int child_caught_sigint;
@@ -2681,6 +2685,7 @@ wait_sigint_cleanup (void)
static void
restore_sigint_handler ()
{
+ cur_sigint_handler = old_sigint_handler;
if (old_sigint_handler != INVALID_SIGNAL_HANDLER)
{
set_signal_handler (SIGINT, old_sigint_handler);
@@ -2703,8 +2708,7 @@ wait_sigint_handler (int sig)
restore_sigint_handler ();
/* If we got a SIGINT while in `wait', and SIGINT is trapped, do
what POSIX.2 says (see builtins/wait.def for more info). */
- if (this_shell_builtin && this_shell_builtin == wait_builtin &&
- signal_is_trapped (SIGINT) &&
+ if (signal_is_trapped (SIGINT) &&
((sigint_handler = trap_to_sighandler (SIGINT)) == trap_handler))
{
trap_handler (SIGINT); /* set pending_traps[SIGINT] */
@@ -2727,6 +2731,8 @@ wait_sigint_handler (int sig)
{
set_exit_status (128+SIGINT);
restore_sigint_handler ();
+ if (cur_sigint_handler == INVALID_SIGNAL_HANDLER)
+ set_sigint_handler (); /* XXX - only do this in one place */
kill (getpid (), SIGINT);
}
@@ -2876,11 +2882,13 @@ wait_for (pid_t pid, int flags)
{
SigHandler *temp_sigint_handler;
- temp_sigint_handler = set_signal_handler (SIGINT, wait_sigint_handler);
- if (temp_sigint_handler == wait_sigint_handler)
- internal_debug ("wait_for: recursively setting old_sigint_handler to wait_sigint_handler: running_trap = %d", running_trap);
- else
- old_sigint_handler = temp_sigint_handler;
+ temp_sigint_handler = old_sigint_handler;
+ old_sigint_handler = set_signal_handler (SIGINT, wait_sigint_handler);
+ if (old_sigint_handler == wait_sigint_handler)
+ {
+ internal_debug ("wait_for: recursively setting old_sigint_handler to wait_sigint_handler: running_trap = %d", running_trap);
+ old_sigint_handler = temp_sigint_handler;
+ }
waiting_for_child = 0;
if (old_sigint_handler == SIG_IGN)
set_signal_handler (SIGINT, old_sigint_handler);
@@ -4105,7 +4113,7 @@ set_job_status_and_cleanup (int job)
SIGINT (if we reset the sighandler to the default).
In this case, we have to fix things up. What a crock. */
if (temp_handler == trap_handler && signal_is_trapped (SIGINT) == 0)
- temp_handler = trap_to_sighandler (SIGINT);
+ temp_handler = trap_to_sighandler (SIGINT);
restore_sigint_handler ();
if (temp_handler == SIG_DFL)
termsig_handler (SIGINT); /* XXX */
--
2.33.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。