about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2008-03-25 18:17:07 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2008-03-25 18:17:07 +0000
commit845faf558661d5c264a335d9e0b474285ffc8962 (patch)
treeecc97346799e954225e7c5b087cbf617e4f02683 /Src
parent56e1904e45cc474a9858dc1205055008f8c63752 (diff)
downloadzsh-845faf558661d5c264a335d9e0b474285ffc8962.tar.gz
zsh-845faf558661d5c264a335d9e0b474285ffc8962.tar.xz
zsh-845faf558661d5c264a335d9e0b474285ffc8962.zip
22281: wait shouldn't return immediately on signal unless trapped
Diffstat (limited to 'Src')
-rw-r--r--Src/jobs.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/Src/jobs.c b/Src/jobs.c
index 9bdc602de..1b3d37c63 100644
--- a/Src/jobs.c
+++ b/Src/jobs.c
@@ -1170,7 +1170,8 @@ waitforpid(pid_t pid, int wait_cmd)
 
 	last_signal = -1;
 	signal_suspend(SIGCHLD);
-	if (last_signal != SIGCHLD && wait_cmd) {
+	if (last_signal != SIGCHLD && wait_cmd && last_signal >= 0 &&
+	    (sigtrapped[last_signal] & ZSIG_TRAPPED)) {
 	    /* wait command interrupted, but no error: return */
 	    restore_queue_signals(q);
 	    return 128 + last_signal;
@@ -1208,7 +1209,8 @@ zwaitjob(int job, int wait_cmd)
 	       !(jn->stat & STAT_DONE) &&
 	       !(interact && (jn->stat & STAT_STOPPED))) {
 	    signal_suspend(SIGCHLD);
-	    if (last_signal != SIGCHLD && wait_cmd)
+	    if (last_signal != SIGCHLD && wait_cmd && last_signal >= 0 &&
+		(sigtrapped[last_signal] & ZSIG_TRAPPED))
 	    {
 		/* builtin wait interrupted by trapped signal */
 		restore_queue_signals(q);