about summary refs log tree commit diff
path: root/Src/jobs.c
diff options
context:
space:
mode:
authorBarton E. Schaefer <schaefer@zsh.org>2016-07-23 10:27:59 -0700
committerBarton E. Schaefer <schaefer@zsh.org>2016-07-23 10:27:59 -0700
commitb7bb60b47e5b07d8bf7c86bd54c0238333d4e7e2 (patch)
tree077ebbef41a35f7112156c5aa1b05c6ad6ba589d /Src/jobs.c
parent00f18f29de1b03364eb4eff1f625bc7df936d607 (diff)
downloadzsh-b7bb60b47e5b07d8bf7c86bd54c0238333d4e7e2.tar.gz
zsh-b7bb60b47e5b07d8bf7c86bd54c0238333d4e7e2.tar.xz
zsh-b7bb60b47e5b07d8bf7c86bd54c0238333d4e7e2.zip
38923: zwaitjob() continues waiting for children that may have ignored the interrupt signal, even if the current shell has been interrupted.
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 3db2ed01f..6bc361609 100644
--- a/Src/jobs.c
+++ b/Src/jobs.c
@@ -1472,7 +1472,7 @@ zwaitjob(int job, int wait_cmd)
 	     */
 	    pipecleanfilelist(jn->filelist, 0);
 	}
-	while (!errflag && jn->stat &&
+	while (!(errflag & ERRFLAG_ERROR) && jn->stat &&
 	       !(jn->stat & STAT_DONE) &&
 	       !(interact && (jn->stat & STAT_STOPPED))) {
 	    signal_suspend(SIGCHLD, wait_cmd);
@@ -1494,6 +1494,13 @@ zwaitjob(int job, int wait_cmd)
 	      that's the one related to ^C.  But that doesn't work.
 	      There's something more here we don't understand.  --pws
 
+	      The change above to ignore ERRFLAG_INT in the loop test
+	      solves a problem wherein child processes that ignore the
+	      INT signal were never waited-for.  Clearing the flag here
+	      still seems the wrong thing, but perhaps ERRFLAG_INT
+	      should be saved and restored around signal_suspend() to
+	      prevent it being lost within a signal trap?  --Bart
+
            errflag = 0; */
 
 	    if (subsh) {