diff --git a/shell/hush.c b/shell/hush.c index ba2081d1b..04853137b 100644 --- a/shell/hush.c +++ b/shell/hush.c @@ -894,7 +894,8 @@ static int check_and_run_traps(int sig) //TODO // case SIGHUP: ... // break; - default: /* SIGTERM, SIGQUIT, SIGTTIN, SIGTTOU, SIGTSTP */ + default: /* ignored: */ + /* SIGTERM, SIGQUIT, SIGTTIN, SIGTTOU, SIGTSTP */ break; } } @@ -4940,7 +4941,7 @@ static void block_signals(int second_time) mask = 0 | (1 << SIGQUIT) | (1 << SIGTERM) - | (1 << SIGHUP) +//TODO | (1 << SIGHUP) #if ENABLE_HUSH_JOB | (1 << SIGTTIN) | (1 << SIGTTOU) | (1 << SIGTSTP) #endif @@ -4983,7 +4984,7 @@ static void maybe_set_to_sigexit(int sig) signal(sig, handler); } } -/* Set handlers to restore tty pgrm and exit */ +/* Set handlers to restore tty pgrp and exit */ static void set_fatal_handlers(void) { /* We _must_ restore tty pgrp on fatal signals */ @@ -4998,8 +4999,9 @@ static void set_fatal_handlers(void) /* bash 3.2 seems to handle these just like 'fatal' ones */ maybe_set_to_sigexit(SIGPIPE); maybe_set_to_sigexit(SIGALRM); +//TODO: disable and move down when proper SIGHUP handling is added maybe_set_to_sigexit(SIGHUP ); - /* if we are interactive, SIGTERM and SIGINT are masked. + /* if we are interactive, [SIGHUP,] SIGTERM and SIGINT are masked. * if we aren't interactive... but in this case * we never want to restore pgrp on exit, and this fn is not called */ /*maybe_set_to_sigexit(SIGTERM);*/ @@ -5075,8 +5077,8 @@ int hush_main(int argc, char **argv) #endif /* Shell is non-interactive at first. We need to call - * block_signals(0) if we are going to execute "sh script", - * "sh -c cmds" or login shell's /etc/profile and friends. + * block_signals(0) if we are going to execute "sh