about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBarton E. Schaefer <schaefer@zsh.org>2015-08-10 12:54:05 -0700
committerBarton E. Schaefer <schaefer@zsh.org>2015-08-10 12:54:05 -0700
commit93ca77f8f73bc58041bcbf8e4319b056504806e5 (patch)
tree2bc582ae7d1c909377fad11ee0ab873ac97799bf
parent6fa8708bfcc44f2efbf8a38169bf62301d98ef0c (diff)
downloadzsh-93ca77f8f73bc58041bcbf8e4319b056504806e5.tar.gz
zsh-93ca77f8f73bc58041bcbf8e4319b056504806e5.tar.xz
zsh-93ca77f8f73bc58041bcbf8e4319b056504806e5.zip
36079: do not allow update_job() and its helpers to run the signal queue while we are processing a job exit.
-rw-r--r--ChangeLog5
-rw-r--r--Src/signals.c8
2 files changed, 13 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 103e7a5d5..472551069 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2015-08-10  Barton E. Schaefer  <schaefer@zsh.org>
+
+	* 36079: Src/signals.c: do not allow update_job() and its helpers
+	to run the signal queue while we are processing a job exit.
+
 2015-08-10  Peter Stephenson  <p.w.stephenson@ntlworld.com>
 
 	* 36083: Src/builtin.c, Test/B02typeset.ztst: set array value
diff --git a/Src/signals.c b/Src/signals.c
index 78dc75b1b..f45c1860c 100644
--- a/Src/signals.c
+++ b/Src/signals.c
@@ -487,6 +487,12 @@ wait_for_processes(void)
 	    break;
 	}
 
+	/* This is necessary to be sure queueing_enabled > 0 when
+	 * we enter printjob() from update_job(), so that we don't
+	 * decrement to zero in should_report_time() and improperly
+	 * run other handlers in the middle of processing this one */
+	queue_signals();
+
 	/*
 	 * Find the process and job containing this pid and
 	 * update it.
@@ -536,6 +542,8 @@ wait_for_processes(void)
 		    WEXITSTATUS(status)));
 	    addbgstatus(pid, val);
 	}
+
+	unqueue_signals();
     }
 }