about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorliuli <liuli@uniontech.com>2023-08-21 05:07:43 +0000
committerGitHub <noreply@github.com>2023-08-21 05:07:43 +0000
commit62d55296c0eb41f1b18b1943fa7aa06e4893d736 (patch)
tree29c6109a0363706794b75a0c3ab1e9fe31ac0d00 /src
parent8e7afcc5fb6c320126c06bc46f7691fb2199634d (diff)
downloadbox64-62d55296c0eb41f1b18b1943fa7aa06e4893d736.tar.gz
box64-62d55296c0eb41f1b18b1943fa7aa06e4893d736.zip
Update my_posix_spawnp()
Diffstat (limited to 'src')
-rw-r--r--src/wrapped/wrappedlibc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/wrapped/wrappedlibc.c b/src/wrapped/wrappedlibc.c
index 06726923..b0241375 100644
--- a/src/wrapped/wrappedlibc.c
+++ b/src/wrapped/wrappedlibc.c
@@ -2228,6 +2228,10 @@ EXPORT int32_t my_posix_spawnp(x64emu_t* emu, pid_t* pid, const char* path,
     int script = (my_context->bashpath && FileIsShell(fullpath))?1:0;
     int ret;
     printf_log(/*LOG_DEBUG*/LOG_INFO, "posix_spawnp(%p, \"%s\", %p, %p, %p, %p), IsX86=%d / fullpath=\"%s\"\n", pid, path, actions, attrp, argv, envp, x64, fullpath);
+    // hack to update the environ var if needed
+    if(envp == my_context->envv && environ) {
+        envp = environ;
+    }
     if (x64 || x86 || script || self) {
         int n=1;
         while(argv[n]) ++n;