diff options
author | Denis Vlasenko | 2008-06-05 01:10:03 +0000 |
---|---|---|
committer | Denis Vlasenko | 2008-06-05 01:10:03 +0000 |
commit | 49b78fc1a8f1591fa172399b3be1dba4b7f23554 (patch) | |
tree | f34271a9e766725cb6ce59c35cc98d91ddf137ac /shell | |
parent | a3087ca7495e33b19b122869d17defeb9c933d19 (diff) | |
download | busybox-1_10_3.zip busybox-1_10_3.tar.gz |
Apply post-1.10.2 fixes, bump version to 1.10.31_10_3
Diffstat (limited to 'shell')
-rw-r--r-- | shell/hush.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/shell/hush.c b/shell/hush.c index 4e6d500..dcaeed0 100644 --- a/shell/hush.c +++ b/shell/hush.c @@ -699,9 +699,18 @@ static const struct built_in_command bltins[] = { BLTIN(NULL, NULL, NULL) }; +/* Signals are grouped, we handle them in batches */ +static void set_misc_sighandler(void (*handler)(int)) +{ + bb_signals(0 + + (1 << SIGINT) + + (1 << SIGQUIT) + + (1 << SIGTERM) + , handler); +} + #if ENABLE_HUSH_JOB -/* Signals are grouped, we handle them in batches */ static void set_fatal_sighandler(void (*handler)(int)) { bb_signals(0 @@ -725,14 +734,6 @@ static void set_jobctrl_sighandler(void (*handler)(int)) + (1 << SIGTTOU) , handler); } -static void set_misc_sighandler(void (*handler)(int)) -{ - bb_signals(0 - + (1 << SIGINT) - + (1 << SIGQUIT) - + (1 << SIGTERM) - , handler); -} /* SIGCHLD is special and handled separately */ static void set_every_sighandler(void (*handler)(int)) @@ -815,7 +816,6 @@ static void hush_exit(int exitcode) #define set_fatal_sighandler(handler) ((void)0) #define set_jobctrl_sighandler(handler) ((void)0) -#define set_misc_sighandler(handler) ((void)0) #define hush_exit(e) exit(e) #endif /* JOB */ @@ -3907,8 +3907,10 @@ int hush_main(int argc, char **argv) /* give up */ interactive_fd = 0; } - if (interactive_fd) + if (interactive_fd) { fcntl(interactive_fd, F_SETFD, FD_CLOEXEC); + set_misc_sighandler(SIG_IGN); + } } #endif |