diff options
author | Peter Stephenson <pws@users.sourceforge.net> | 2002-11-08 10:43:48 +0000 |
---|---|---|
committer | Peter Stephenson <pws@users.sourceforge.net> | 2002-11-08 10:43:48 +0000 |
commit | 2c75ac82e9902818a229d51ace1aa077356a3b63 (patch) | |
tree | 33e4ce867c8818108a404e4472ac6df9165dfc56 /Src | |
parent | 83b3b0769a11b1fb8060695efb72c17a55d04cea (diff) | |
download | zsh-2c75ac82e9902818a229d51ace1aa077356a3b63.tar.gz zsh-2c75ac82e9902818a229d51ace1aa077356a3b63.tar.xz zsh-2c75ac82e9902818a229d51ace1aa077356a3b63.zip |
17861 from Philippe Troin: make signal initialisation more consistent
Diffstat (limited to 'Src')
-rw-r--r-- | Src/init.c | 32 |
1 files changed, 9 insertions, 23 deletions
diff --git a/Src/init.c b/Src/init.c index dca115eb6..67ed1815b 100644 --- a/Src/init.c +++ b/Src/init.c @@ -883,6 +883,12 @@ setupvals(void) void init_signals(void) { + if (interact) { + int i; + signal_setmask(signal_mask(0)); + for (i=0; i<NSIG; ++i) + signal_default(i); + } sigchld_mask = signal_mask(SIGCHLD); intr(); @@ -898,31 +904,11 @@ init_signals(void) #endif if (interact) { install_handler(SIGALRM); - signal_ignore(SIGTERM); } if (jobbing) { - long ttypgrp; - - while ((ttypgrp = gettygrp()) != -1 && ttypgrp != mypgrp) - kill(0, SIGTTIN); - if (ttypgrp == -1) { - opts[MONITOR] = 0; - } else { - signal_ignore(SIGTTOU); - signal_ignore(SIGTSTP); - signal_ignore(SIGTTIN); - attachtty(mypgrp); - } - } - if (islogin) { - signal_setmask(signal_mask(0)); - } else if (interact) { - sigset_t set; - - sigemptyset(&set); - sigaddset(&set, SIGINT); - sigaddset(&set, SIGQUIT); - signal_unblock(set); + signal_ignore(SIGTTOU); + signal_ignore(SIGTSTP); + signal_ignore(SIGTTIN); } } |