aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--shell/hush.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/shell/hush.c b/shell/hush.c
index 64c1d3dd6..c8bcf9b59 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -994,22 +994,12 @@ static void set_fatal_signals_to_sigexit(void)
994 /*maybe_set_sighandler(SIGTERM);*/ 994 /*maybe_set_sighandler(SIGTERM);*/
995 /*maybe_set_sighandler(SIGINT );*/ 995 /*maybe_set_sighandler(SIGINT );*/
996} 996}
997/* Used only to suppress ^Z in `cmd` */
998static void set_jobctrl_signals_to_IGN(void)
999{
1000 bb_signals(0
1001 + (1 << SIGTSTP)
1002 + (1 << SIGTTIN)
1003 + (1 << SIGTTOU)
1004 , SIG_IGN);
1005}
1006 997
1007#else /* !JOB */ 998#else /* !JOB */
1008 999
1009#define set_fatal_signals_to_sigexit(handler) ((void)0) 1000#define set_fatal_signals_to_sigexit(handler) ((void)0)
1010#define set_jobctrl_signals_to_IGN(handler) ((void)0)
1011 1001
1012#endif /* JOB */ 1002#endif
1013 1003
1014/* Restores tty foreground process group, and exits. */ 1004/* Restores tty foreground process group, and exits. */
1015static void hush_exit(int exitcode) NORETURN; 1005static void hush_exit(int exitcode) NORETURN;
@@ -3754,7 +3744,11 @@ static FILE *generate_stream_from_list(struct pipe *head)
3754 * 'command execution'. 3744 * 'command execution'.
3755 * SUSv3 says ctrl-Z should be ignored, ctrl-C should not. 3745 * SUSv3 says ctrl-Z should be ignored, ctrl-C should not.
3756 */ 3746 */
3757 set_jobctrl_signals_to_IGN(); 3747 bb_signals(0
3748 + (1 << SIGTSTP)
3749 + (1 << SIGTTIN)
3750 + (1 << SIGTTOU)
3751 , SIG_IGN);
3758 3752
3759 /* Note: freeing 'head' here would break NOMMU. */ 3753 /* Note: freeing 'head' here would break NOMMU. */
3760 _exit(run_list(head)); 3754 _exit(run_list(head));