diff options
Diffstat (limited to '')
-rw-r--r-- | shell/hush.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/shell/hush.c b/shell/hush.c index 9b87e28cf..80a39925f 100644 --- a/shell/hush.c +++ b/shell/hush.c | |||
@@ -1831,7 +1831,10 @@ static void restore_G_args(save_arg_t *sv, char **argv) | |||
1831 | * SIGHUP (interactive): | 1831 | * SIGHUP (interactive): |
1832 | * send SIGCONT to stopped jobs, send SIGHUP to all jobs and exit | 1832 | * send SIGCONT to stopped jobs, send SIGHUP to all jobs and exit |
1833 | //HUP: we don't need to do this, kernel does this for us | 1833 | //HUP: we don't need to do this, kernel does this for us |
1834 | //HUP: ("orphaned process group" handling according to POSIX) | 1834 | //HUP: ("orphaned process group" handling according to POSIX). |
1835 | //HUP: We still have a SIGHUP handler, just to have tty pgrp restored | ||
1836 | //HUP: (otherwise e.g. Midnight Commander backgrounds when hush | ||
1837 | //HUP: started from it gets killed by SIGHUP). | ||
1835 | * SIGTTIN, SIGTTOU, SIGTSTP (if job control is on): ignore | 1838 | * SIGTTIN, SIGTTOU, SIGTSTP (if job control is on): ignore |
1836 | * Note that ^Z is handled not by trapping SIGTSTP, but by seeing | 1839 | * Note that ^Z is handled not by trapping SIGTSTP, but by seeing |
1837 | * that all pipe members are stopped. Try this in bash: | 1840 | * that all pipe members are stopped. Try this in bash: |
@@ -1933,7 +1936,7 @@ enum { | |||
1933 | SPECIAL_INTERACTIVE_SIGS = 0 | 1936 | SPECIAL_INTERACTIVE_SIGS = 0 |
1934 | | (1 << SIGTERM) | 1937 | | (1 << SIGTERM) |
1935 | | (1 << SIGINT) | 1938 | | (1 << SIGINT) |
1936 | //HUP | (1 << SIGHUP) | 1939 | | (1 << SIGHUP) |
1937 | , | 1940 | , |
1938 | SPECIAL_JOBSTOP_SIGS = 0 | 1941 | SPECIAL_JOBSTOP_SIGS = 0 |
1939 | #if ENABLE_HUSH_JOB | 1942 | #if ENABLE_HUSH_JOB |
@@ -2179,7 +2182,7 @@ static int check_and_run_traps(void) | |||
2179 | last_sig = sig; | 2182 | last_sig = sig; |
2180 | break; | 2183 | break; |
2181 | #if ENABLE_HUSH_JOB | 2184 | #if ENABLE_HUSH_JOB |
2182 | //HUP case SIGHUP: { | 2185 | case SIGHUP: { |
2183 | //HUP//TODO: why are we doing this? ash and dash don't do this, | 2186 | //HUP//TODO: why are we doing this? ash and dash don't do this, |
2184 | //HUP//they have no handler for SIGHUP at all, | 2187 | //HUP//they have no handler for SIGHUP at all, |
2185 | //HUP//they rely on kernel to send SIGHUP+SIGCONT to orphaned process groups | 2188 | //HUP//they rely on kernel to send SIGHUP+SIGCONT to orphaned process groups |
@@ -2194,8 +2197,8 @@ static int check_and_run_traps(void) | |||
2194 | //HUP if (kill(- job->pgrp, SIGHUP) == 0) | 2197 | //HUP if (kill(- job->pgrp, SIGHUP) == 0) |
2195 | //HUP kill(- job->pgrp, SIGCONT); | 2198 | //HUP kill(- job->pgrp, SIGCONT); |
2196 | //HUP } | 2199 | //HUP } |
2197 | //HUP sigexit(SIGHUP); | 2200 | sigexit(SIGHUP); |
2198 | //HUP } | 2201 | } |
2199 | #endif | 2202 | #endif |
2200 | #if ENABLE_HUSH_FAST | 2203 | #if ENABLE_HUSH_FAST |
2201 | case SIGCHLD: | 2204 | case SIGCHLD: |