diff options
author | Chet Ramey <chet.ramey@case.edu> | 2014-01-29 17:00:07 -0500 |
---|---|---|
committer | Chet Ramey <chet.ramey@case.edu> | 2014-01-29 17:00:07 -0500 |
commit | b6e23235f28b1c85e18e9a2b7ba8c6b6c46aecbc (patch) | |
tree | 00fdd9c37c261d89c994fc1856252df719afec3a /sig.c | |
parent | 8581f42df9a1b1d848e2d4bdf3cc951b8d14b5be (diff) | |
download | bash-4.3-testing.tar.gz |
bash-4.3-rc2 overlaybash-4.3-rc2bash-4.3-testing
Diffstat (limited to 'sig.c')
-rw-r--r-- | sig.c | 16 |
1 files changed, 14 insertions, 2 deletions
@@ -43,6 +43,7 @@ #include "trap.h" #include "builtins/common.h" +#include "builtins/builtext.h" #if defined (READLINE) # include "bashline.h" @@ -64,6 +65,8 @@ extern int parse_and_execute_level, shell_initialized; extern int history_lines_this_session; #endif extern int no_line_editing; +extern int wait_signal_received; +extern sh_builtin_func_t *this_shell_builtin; extern void initialize_siglist (); @@ -263,7 +266,7 @@ initialize_terminating_signals () if (interactive_shell == 0 && XHANDLER (i) == SIG_IGN) { sigaction (XSIG (i), &oact, &act); - set_signal_ignored (XSIG (i)); + set_signal_hard_ignored (XSIG (i)); } #if defined (SIGPROF) && !defined (_MINIX) if (XSIG (i) == SIGPROF && XHANDLER (i) != SIG_DFL && XHANDLER (i) != SIG_IGN) @@ -287,7 +290,7 @@ initialize_terminating_signals () if (interactive_shell == 0 && XHANDLER (i) == SIG_IGN) { signal (XSIG (i), SIG_IGN); - set_signal_ignored (XSIG (i)); + set_signal_hard_ignored (XSIG (i)); } #ifdef SIGPROF if (XSIG (i) == SIGPROF && XHANDLER (i) != SIG_DFL && XHANDLER (i) != SIG_IGN) @@ -597,6 +600,15 @@ sigint_sighandler (sig) if (interrupt_state == 0) ADDINTERRUPT; + /* We will get here in interactive shells with job control active; allow + an interactive wait to be interrupted. */ + if (this_shell_builtin && this_shell_builtin == wait_builtin) + { + last_command_exit_value = 128 + sig; + wait_signal_received = sig; + SIGRETURN (0); + } + if (interrupt_immediately) { interrupt_immediately = 0; |