summaryrefslogtreecommitdiffhomepage
path: root/shell/hush.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2017-08-04 14:28:16 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2017-08-04 14:28:16 +0200
commit49e6bf2db92d896a71d08eb364069ba50fa82781 (patch)
treeb0940fde4d99a73e1a27c7ad0b610fe7e3f1be0c /shell/hush.c
parent3346b4afc5c81d53eae4e7fc7e12ebd6fa573a4e (diff)
sheel: improve comments on signal handling
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/hush.c')
-rw-r--r--shell/hush.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/shell/hush.c b/shell/hush.c
index b04f793f1..bb80f422c 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -1979,6 +1979,9 @@ static int check_and_run_traps(void)
break;
#if ENABLE_HUSH_JOB
case SIGHUP: {
+//TODO: why are we doing this? ash and dash don't do this,
+//they have no handler for SIGHUP at all,
+//they rely on kernel to send SIGHUP+SIGCONT to orphaned process groups
struct pipe *job;
debug_printf_exec("%s: sig:%d default SIGHUP handler\n", __func__, sig);
/* bash is observed to signal whole process groups,
@@ -8646,6 +8649,10 @@ static void install_sighandlers(unsigned mask)
*/
if (sig == SIGCHLD)
continue;
+ /* bash re-enables SIGHUP which is SIG_IGNed on entry.
+ * Try: "trap '' HUP; bash; echo RET" and type "kill -HUP $$"
+ */
+ //if (sig == SIGHUP) continue; - TODO?
if (old_handler == SIG_IGN) {
/* oops... restore back to IGN, and record this fact */
install_sighandler(sig, old_handler);