aboutsummaryrefslogtreecommitdiff
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)
downloadbusybox-w32-49e6bf2db92d896a71d08eb364069ba50fa82781.tar.gz
busybox-w32-49e6bf2db92d896a71d08eb364069ba50fa82781.tar.bz2
busybox-w32-49e6bf2db92d896a71d08eb364069ba50fa82781.zip
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)
1979 break; 1979 break;
1980#if ENABLE_HUSH_JOB 1980#if ENABLE_HUSH_JOB
1981 case SIGHUP: { 1981 case SIGHUP: {
1982//TODO: why are we doing this? ash and dash don't do this,
1983//they have no handler for SIGHUP at all,
1984//they rely on kernel to send SIGHUP+SIGCONT to orphaned process groups
1982 struct pipe *job; 1985 struct pipe *job;
1983 debug_printf_exec("%s: sig:%d default SIGHUP handler\n", __func__, sig); 1986 debug_printf_exec("%s: sig:%d default SIGHUP handler\n", __func__, sig);
1984 /* bash is observed to signal whole process groups, 1987 /* bash is observed to signal whole process groups,
@@ -8646,6 +8649,10 @@ static void install_sighandlers(unsigned mask)
8646 */ 8649 */
8647 if (sig == SIGCHLD) 8650 if (sig == SIGCHLD)
8648 continue; 8651 continue;
8652 /* bash re-enables SIGHUP which is SIG_IGNed on entry.
8653 * Try: "trap '' HUP; bash; echo RET" and type "kill -HUP $$"
8654 */
8655 //if (sig == SIGHUP) continue; - TODO?
8649 if (old_handler == SIG_IGN) { 8656 if (old_handler == SIG_IGN) {
8650 /* oops... restore back to IGN, and record this fact */ 8657 /* oops... restore back to IGN, and record this fact */
8651 install_sighandler(sig, old_handler); 8658 install_sighandler(sig, old_handler);