about summary refs log tree commit diff
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
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.
-rw-r--r--ChangeLog6
-rw-r--r--Src/jobs.c9
2 files changed, 14 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 5446378ce..83788121d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2016-07-23  Barton E. Schaefer  <schaefer@zsh.org>
+
+	* 38923 (plus expanded comment): Src/jobs.c: zwaitjob() continues
+	waiting for children that may have ignored the interrupt signal,
+	even if the current shell has been interrupted.
+
 2016-07-22  Daniel Shahaf  <d.s@daniel.shahaf.name>
 
 	* users/21779: Doc/Zsh/expn.yo: Clarify documentation of the
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) {