From c44f23f4acbbd854eccd962110e41343d8f03296 Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Thu, 8 Feb 2024 13:13:08 +0000 Subject: ash: allow nofork applets in Windows on ARM + UCRT Commit ea8742bc16 (ash: workaround environment issue in Windows on ARM) prevented nofork applets from being run without a fork in standalone shell mode in Windows on ARM. This was due to a deficiency in the handling of the 'environ' global. However, the problem is specific to MSVCRT. If the target is UCRT nofork applets can be made to work without a fork. --- shell/ash.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/shell/ash.c b/shell/ash.c index 5b73c3c66..31d3c1013 100644 --- a/shell/ash.c +++ b/shell/ash.c @@ -11665,7 +11665,8 @@ evalcommand(union node *cmd, int flags) //TODO: find a better solution for Windows on ARM than ignoring NOFORK #if ENABLE_FEATURE_SH_STANDALONE \ && ENABLE_FEATURE_SH_NOFORK \ - && NUM_APPLETS > 1 && !(defined(_ARM64_) && ENABLE_PLATFORM_MINGW32) + && NUM_APPLETS > 1 \ + && !(defined(_ARM64_) && !defined(_UCRT) && ENABLE_PLATFORM_MINGW32) /* (1) BUG: if variables are set, we need to fork, or save/restore them * around run_nofork_applet() call. * (2) Should this check also be done in forkshell()? -- cgit v1.2.3-55-g6feb