summaryrefslogtreecommitdiff
path: root/jobs.c~
diff options
context:
space:
mode:
authorChet Ramey <chet.ramey@case.edu>2011-12-07 09:24:27 -0500
committerChet Ramey <chet.ramey@case.edu>2011-12-07 09:24:27 -0500
commited35cb4a6394a5121724fc8a2c0ace6eb5be9de1 (patch)
treee21014b9aa0aba059196693ef7e0b2c817ca0953 /jobs.c~
parent8943768b87f00cb5ce36f5aa494471c9a9e09652 (diff)
downloadbash-ed35cb4a6394a5121724fc8a2c0ace6eb5be9de1.tar.gz
commit bash-20080529 snapshot
Diffstat (limited to 'jobs.c~')
-rw-r--r--jobs.c~19
1 files changed, 14 insertions, 5 deletions
diff --git a/jobs.c~ b/jobs.c~
index 1414bc46..ce6305ac 100644
--- a/jobs.c~
+++ b/jobs.c~
@@ -217,8 +217,6 @@ int check_window_size;
/* Functions local to this file. */
-static void run_sigchld_trap __P((int));
-
static sighandler wait_sigint_handler __P((int));
static sighandler sigchld_handler __P((int));
static sighandler sigcont_sighandler __P((int));
@@ -2214,6 +2212,7 @@ wait_sigint_handler (sig)
/* XXX - should this be interrupt_state? If it is, the shell will act
as if it got the SIGINT interrupt. */
wait_sigint_received = 1;
+
/* Otherwise effectively ignore the SIGINT and allow the running job to
be killed. */
SIGRETURN (0);
@@ -3122,7 +3121,17 @@ waitchld (wpid, block)
/* Call a SIGCHLD trap handler for each child that exits, if one is set. */
if (job_control && signal_is_trapped (SIGCHLD) && children_exited &&
trap_list[SIGCHLD] != (char *)IGNORE_SIG)
- run_sigchld_trap (children_exited);
+ {
+ if (posixly_correct && this_shell_builtin && this_shell_builtin == wait_builtin)
+ {
+ interrupt_immediately = 0;
+ trap_handler (SIGCHLD); /* set pending_traps[SIGCHLD] */
+ wait_signal_received = SIGCHLD;
+ longjmp (wait_intr_buf, 1);
+ }
+
+ run_sigchld_trap (children_exited);
+ }
/* We have successfully recorded the useful information about this process
that has just changed state. If we notify asynchronously, and the job
@@ -3341,7 +3350,7 @@ setjstatus (j)
#endif
}
-static void
+void
run_sigchld_trap (nchild)
int nchild;
{
@@ -3372,7 +3381,7 @@ run_sigchld_trap (nchild)
subst_assign_varlist = (WORD_LIST *)NULL;
the_pipeline = (PROCESS *)NULL;
- restore_default_signal (SIGCHLD);
+ set_impossible_sigchld_trap ();
jobs_list_frozen = 1;
for (i = 0; i < nchild; i++)
{