about summary refs log tree commit diff
path: root/Src/jobs.c
diff options
context:
space:
mode:
Diffstat (limited to 'Src/jobs.c')
-rw-r--r--Src/jobs.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/Src/jobs.c b/Src/jobs.c
index 0188989df..072a91744 100644
--- a/Src/jobs.c
+++ b/Src/jobs.c
@@ -994,7 +994,11 @@ zwaitjob(int job, int sig)
     int q = queue_signal_level();
     Job jn = jobtab + job;
 
-    dont_queue_signals();
+    queue_not_sigchld++;
+    if (isset(TRAPSASYNC))
+	dont_queue_signals();
+    else
+	queue_signals();
     child_block();		 /* unblocked during child_suspend() */
     if (jn->procs || jn->auxprocs) { /* if any forks were done         */
 	jn->stat |= STAT_LOCKED;
@@ -1026,6 +1030,9 @@ zwaitjob(int job, int sig)
     }
     child_unblock();
     restore_queue_signals(q);
+    if (!queueing_enabled)
+	run_queued_signals();
+    queue_not_sigchld--;
 }
 
 /* wait for running job to finish */