about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2005-06-28 09:37:21 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2005-06-28 09:37:21 +0000
commita6660cadc66f21a9fcbf1f388f2c163c0561b53a (patch)
treebd376e0106d338be99e7e1d9fe3bd1b1ee18d8f5
parent9b9e5a3ac0d9213e112dcf95a272c5a993eef2df (diff)
downloadzsh-a6660cadc66f21a9fcbf1f388f2c163c0561b53a.tar.gz
zsh-a6660cadc66f21a9fcbf1f388f2c163c0561b53a.tar.xz
zsh-a6660cadc66f21a9fcbf1f388f2c163c0561b53a.zip
21391: only pass SIGINT and SIGQUIT from foreground processes to the shell.
-rw-r--r--ChangeLog7
-rw-r--r--Src/jobs.c6
2 files changed, 11 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 0acc1460c..63c17687f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2005-06-28  Peter Stephenson  <pws@csr.com>
+
+	* 21391: Src/jobs.c: Restrict passing of signals from foreground
+	processes to the shell to SIGINT and SIGQUIT (i.e. those
+	generated from the keyboard).  This removes some unexpected
+	behaviour with SIGPIPE being passed to the shell.
+
 2005-06-27  Doug Kearns  <djkea2@gus.gscit.monash.edu.au>
 
 	* unposted: Completion/Unix/Type/_urls: complete WWW_HOME, ftp_proxy
diff --git a/Src/jobs.c b/Src/jobs.c
index f5ade7c2b..a22a8a6a8 100644
--- a/Src/jobs.c
+++ b/Src/jobs.c
@@ -383,7 +383,8 @@ update_job(Job jn)
 		}
 		/* If we have `foo|while true; (( x++ )); done', and hit
 		 * ^C, we have to stop the loop, too. */
-		if ((val & 0200) && inforeground == 1) {
+		if ((val & 0200) && inforeground == 1 &&
+		    ((val & ~0200) == SIGINT || (val & ~0200) == SIGQUIT)) {
 		    if (!errbrk_saved) {
 			errbrk_saved = 1;
 			prev_breaks = breaks;
@@ -399,7 +400,8 @@ update_job(Job jn)
 		adjustwinsize(0);
 	    }
 	}
-    } else if (list_pipe && (val & 0200) && inforeground == 1) {
+    } else if (list_pipe && (val & 0200) && inforeground == 1 &&
+	       ((val & ~0200) == SIGINT || (val & ~0200) == SIGQUIT)) {
 	if (!errbrk_saved) {
 	    errbrk_saved = 1;
 	    prev_breaks = breaks;