diff --git a/bin/sh/options.c b/bin/sh/options.c index 56cc5e7397c8..8b501f2d1b6a 100644 --- a/bin/sh/options.c +++ b/bin/sh/options.c @@ -131,7 +131,7 @@ procargs(int argc, char **argv) void optschanged(void) { - setinteractive(iflag); + setinteractive(); #ifndef NO_HISTORY histedit(); #endif diff --git a/bin/sh/trap.c b/bin/sh/trap.c index d67030d370ac..ba643d3485df 100644 --- a/bin/sh/trap.c +++ b/bin/sh/trap.c @@ -478,19 +478,14 @@ dotrap(void) /* - * Controls whether the shell is interactive or not. + * Controls whether the shell is interactive or not based on iflag. */ void -setinteractive(int on) +setinteractive(void) { - static int is_interactive = -1; - - if (on == is_interactive) - return; setsignal(SIGINT); setsignal(SIGQUIT); setsignal(SIGTERM); - is_interactive = on; } diff --git a/bin/sh/trap.h b/bin/sh/trap.h index 8d6cb09c30ba..b9c43f336141 100644 --- a/bin/sh/trap.h +++ b/bin/sh/trap.h @@ -43,6 +43,6 @@ void ignoresig(int); int issigchldtrapped(void); void onsig(int); void dotrap(void); -void setinteractive(int); +void setinteractive(void); void exitshell(int) __dead2; void exitshell_savedstatus(void) __dead2;