From 594aac64fb94168c5345dd53a1e0231ed7c78418 Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Tue, 22 Aug 2017 15:30:29 +0100 Subject: Revert "ash: allow long-running nofork applets to be interrupted" This reverts commit f5051d07f196a8ff7aeaae762333d5aa2b824088. Upstream made 'yes' and 'seq' NOEXEC rather than NOFORK which also solves the problem, though NOEXEC doesn't provide any gain in busybox-w32. --- include/libbb.h | 3 --- libbb/appletlib.c | 16 ---------------- shell/ash.c | 10 +--------- 3 files changed, 1 insertion(+), 28 deletions(-) diff --git a/include/libbb.h b/include/libbb.h index 6073cbf4a..c95f43954 100644 --- a/include/libbb.h +++ b/include/libbb.h @@ -1150,9 +1150,6 @@ void set_task_comm(const char *comm) FAST_FUNC; #else # define set_task_comm(name) ((void)0) #endif -#if ENABLE_PLATFORM_MINGW32 && ENABLE_FEATURE_SH_NOFORK -extern int long_running_applet(int applet_no) FAST_FUNC; -#endif /* Helpers for daemonization. * diff --git a/libbb/appletlib.c b/libbb/appletlib.c index 6330b6f8b..71ee0dd07 100644 --- a/libbb/appletlib.c +++ b/libbb/appletlib.c @@ -302,22 +302,6 @@ int FAST_FUNC find_applet_by_name(const char *name) #endif } -# if ENABLE_PLATFORM_MINGW32 && ENABLE_FEATURE_SH_NOFORK -int FAST_FUNC long_running_applet(int applet_no) -{ - int ret = 0; - -#if defined(APPLET_NO_seq) - ret |= (applet_no == APPLET_NO_seq); -#endif -#if defined(APPLET_NO_yes) - ret |= (applet_no == APPLET_NO_yes); -#endif - - return ret; -} -#endif - void lbb_prepare(const char *applet IF_FEATURE_INDIVIDUAL(, char **argv)) diff --git a/shell/ash.c b/shell/ash.c index ac1ae05fc..af0c68dcf 100644 --- a/shell/ash.c +++ b/shell/ash.c @@ -10394,15 +10394,7 @@ evalcommand(union node *cmd, int flags) */ /* find_command() encodes applet_no as (-2 - applet_no) */ int applet_no = (- cmdentry.u.index - 2); - if (applet_no >= 0 && APPLET_IS_NOFORK(applet_no) -#if ENABLE_PLATFORM_MINGW32 - /* - * Fork long-running nofork applets (e.g. yes) in interactive - * sessions. Otherwise ctrl-c won't let the user kill them. - */ - && !(iflag && long_running_applet(applet_no)) -#endif - ) { + if (applet_no >= 0 && APPLET_IS_NOFORK(applet_no)) { listsetvar(varlist.list, VEXPORT|VSTACK); /* * Run _main(). -- cgit v1.2.3-55-g6feb