diff options
author | Ron Yorston <rmy@pobox.com> | 2017-08-22 15:30:29 +0100 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2017-08-22 15:30:29 +0100 |
commit | 594aac64fb94168c5345dd53a1e0231ed7c78418 (patch) | |
tree | 287fb5c9e57efdb40056c0ef234d5d870dde5103 | |
parent | bcacae6da4e772f208ef2026fae5faaac9048411 (diff) | |
download | busybox-w32-594aac64fb94168c5345dd53a1e0231ed7c78418.tar.gz busybox-w32-594aac64fb94168c5345dd53a1e0231ed7c78418.tar.bz2 busybox-w32-594aac64fb94168c5345dd53a1e0231ed7c78418.zip |
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.
-rw-r--r-- | include/libbb.h | 3 | ||||
-rw-r--r-- | libbb/appletlib.c | 16 | ||||
-rw-r--r-- | shell/ash.c | 10 |
3 files changed, 1 insertions, 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; | |||
1150 | #else | 1150 | #else |
1151 | # define set_task_comm(name) ((void)0) | 1151 | # define set_task_comm(name) ((void)0) |
1152 | #endif | 1152 | #endif |
1153 | #if ENABLE_PLATFORM_MINGW32 && ENABLE_FEATURE_SH_NOFORK | ||
1154 | extern int long_running_applet(int applet_no) FAST_FUNC; | ||
1155 | #endif | ||
1156 | 1153 | ||
1157 | /* Helpers for daemonization. | 1154 | /* Helpers for daemonization. |
1158 | * | 1155 | * |
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) | |||
302 | #endif | 302 | #endif |
303 | } | 303 | } |
304 | 304 | ||
305 | # if ENABLE_PLATFORM_MINGW32 && ENABLE_FEATURE_SH_NOFORK | ||
306 | int FAST_FUNC long_running_applet(int applet_no) | ||
307 | { | ||
308 | int ret = 0; | ||
309 | |||
310 | #if defined(APPLET_NO_seq) | ||
311 | ret |= (applet_no == APPLET_NO_seq); | ||
312 | #endif | ||
313 | #if defined(APPLET_NO_yes) | ||
314 | ret |= (applet_no == APPLET_NO_yes); | ||
315 | #endif | ||
316 | |||
317 | return ret; | ||
318 | } | ||
319 | #endif | ||
320 | |||
321 | 305 | ||
322 | void lbb_prepare(const char *applet | 306 | void lbb_prepare(const char *applet |
323 | IF_FEATURE_INDIVIDUAL(, char **argv)) | 307 | 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) | |||
10394 | */ | 10394 | */ |
10395 | /* find_command() encodes applet_no as (-2 - applet_no) */ | 10395 | /* find_command() encodes applet_no as (-2 - applet_no) */ |
10396 | int applet_no = (- cmdentry.u.index - 2); | 10396 | int applet_no = (- cmdentry.u.index - 2); |
10397 | if (applet_no >= 0 && APPLET_IS_NOFORK(applet_no) | 10397 | if (applet_no >= 0 && APPLET_IS_NOFORK(applet_no)) { |
10398 | #if ENABLE_PLATFORM_MINGW32 | ||
10399 | /* | ||
10400 | * Fork long-running nofork applets (e.g. yes) in interactive | ||
10401 | * sessions. Otherwise ctrl-c won't let the user kill them. | ||
10402 | */ | ||
10403 | && !(iflag && long_running_applet(applet_no)) | ||
10404 | #endif | ||
10405 | ) { | ||
10406 | listsetvar(varlist.list, VEXPORT|VSTACK); | 10398 | listsetvar(varlist.list, VEXPORT|VSTACK); |
10407 | /* | 10399 | /* |
10408 | * Run <applet>_main(). | 10400 | * Run <applet>_main(). |