From a6660cadc66f21a9fcbf1f388f2c163c0561b53a Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Tue, 28 Jun 2005 09:37:21 +0000 Subject: 21391: only pass SIGINT and SIGQUIT from foreground processes to the shell. --- ChangeLog | 7 +++++++ Src/jobs.c | 6 ++++-- 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 + + * 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 * 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; -- cgit 1.4.1