diff options
Diffstat (limited to 'shell')
-rw-r--r-- | shell/hush.c | 36 |
1 files changed, 21 insertions, 15 deletions
diff --git a/shell/hush.c b/shell/hush.c index 8afa15e89..4d4843173 100644 --- a/shell/hush.c +++ b/shell/hush.c | |||
@@ -709,28 +709,34 @@ static void signal_SA_RESTART(int sig, void (*handler)(int)) | |||
709 | /* Signals are grouped, we handle them in batches */ | 709 | /* Signals are grouped, we handle them in batches */ |
710 | static void set_fatal_sighandler(void (*handler)(int)) | 710 | static void set_fatal_sighandler(void (*handler)(int)) |
711 | { | 711 | { |
712 | signal(SIGILL , handler); | 712 | bb_signals(0 |
713 | signal(SIGTRAP, handler); | 713 | + (1 << SIGILL) |
714 | signal(SIGABRT, handler); | 714 | + (1 << SIGTRAP) |
715 | signal(SIGFPE , handler); | 715 | + (1 << SIGABRT) |
716 | signal(SIGBUS , handler); | 716 | + (1 << SIGFPE) |
717 | signal(SIGSEGV, handler); | 717 | + (1 << SIGBUS) |
718 | + (1 << SIGSEGV) | ||
718 | /* bash 3.2 seems to handle these just like 'fatal' ones */ | 719 | /* bash 3.2 seems to handle these just like 'fatal' ones */ |
719 | signal(SIGHUP , handler); | 720 | + (1 << SIGHUP) |
720 | signal(SIGPIPE, handler); | 721 | + (1 << SIGPIPE) |
721 | signal(SIGALRM, handler); | 722 | + (1 << SIGALRM) |
723 | , handler); | ||
722 | } | 724 | } |
723 | static void set_jobctrl_sighandler(void (*handler)(int)) | 725 | static void set_jobctrl_sighandler(void (*handler)(int)) |
724 | { | 726 | { |
725 | signal(SIGTSTP, handler); | 727 | bb_signals(0 |
726 | signal(SIGTTIN, handler); | 728 | + (1 << SIGTSTP) |
727 | signal(SIGTTOU, handler); | 729 | + (1 << SIGTTIN) |
730 | + (1 << SIGTTOU) | ||
731 | , handler); | ||
728 | } | 732 | } |
729 | static void set_misc_sighandler(void (*handler)(int)) | 733 | static void set_misc_sighandler(void (*handler)(int)) |
730 | { | 734 | { |
731 | signal(SIGINT , handler); | 735 | bb_signals(0 |
732 | signal(SIGQUIT, handler); | 736 | + (1 << SIGINT) |
733 | signal(SIGTERM, handler); | 737 | + (1 << SIGQUIT) |
738 | + (1 << SIGTERM) | ||
739 | , handler); | ||
734 | } | 740 | } |
735 | /* SIGCHLD is special and handled separately */ | 741 | /* SIGCHLD is special and handled separately */ |
736 | 742 | ||