aboutsummaryrefslogtreecommitdiff
path: root/win32/process.c
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2021-11-12 13:56:22 +0000
committerRon Yorston <rmy@pobox.com>2021-11-12 13:56:22 +0000
commit3d660bd84208ffc797f9d41423a8951123b3e46e (patch)
tree549b46d79633b4e03822a9f91dd00bae62533b3a /win32/process.c
parent9e12622a8706a0d23a3ff8792773e73b0d6108b4 (diff)
downloadbusybox-w32-ucrt_hack.tar.gz
busybox-w32-ucrt_hack.tar.bz2
busybox-w32-ucrt_hack.zip
win32: another attempt at a UCRT hackucrt_hack
The problem with UCRT seems to be that if a process has been started with a non-NULL environment block passed to CreateProcess() any subsequent call to spawnve() with a non-NULL environment pointer fails. Commit 5b48ca53b (win32: pass NULL to spawnve, not environ) fixed the problem in busybox-w32 for those cases where a NULL environment pointer was sufficient. It didn't handle the case where the shell passes a modified environment to its child. All calls to spawnve() in the shell occur in a process which will terminate whether or not the call succeeds. It therefore doesn't matter if we mess with the environment of this process such that spawnve() can be passed a NULL environment pointer. (I think.)
Diffstat (limited to '')
-rw-r--r--win32/process.c8
1 files changed, 0 insertions, 8 deletions
diff --git a/win32/process.c b/win32/process.c
index 137cb6a39..812e259f4 100644
--- a/win32/process.c
+++ b/win32/process.c
@@ -268,14 +268,6 @@ spawnveq(int mode, const char *path, char *const *argv, char *const *env)
268 new_path = xasprintf("%s.", path); 268 new_path = xasprintf("%s.", path);
269 } 269 }
270 270
271#if defined(_UCRT)
272 if (env) {
273 char buffer[64];
274
275 sprintf(buffer, "BB_HELLO_%d", getpid());
276 SetEnvironmentVariable(buffer, "1");
277 }
278#endif
279 errno = 0; 271 errno = 0;
280 ret = spawnve(mode, new_path ? new_path : path, new_argv, env); 272 ret = spawnve(mode, new_path ? new_path : path, new_argv, env);
281 273