summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwtc%netscape.com <devnull@localhost>1998-09-20 00:21:35 +0000
committerwtc%netscape.com <devnull@localhost>1998-09-20 00:21:35 +0000
commitf20edc3cdc83adee477b6a6b50aaef20176f0a45 (patch)
tree527a76220871e0ef4d081555eca7bbb59cebcef6
parent3627e09889e95d9408dd1373791041d7bcdd78f0 (diff)
downloadnspr-hg-f20edc3cdc83adee477b6a6b50aaef20176f0a45.tar.gz
Bug fix: If the envp argument for PR_CreateProcess is NULL,
call execv (instead of execve) so that the new process inherits the environment of the parent process.
-rw-r--r--pr/src/md/unix/uxproces.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/pr/src/md/unix/uxproces.c b/pr/src/md/unix/uxproces.c
index 3ae497ea..ecbc14d7 100644
--- a/pr/src/md/unix/uxproces.c
+++ b/pr/src/md/unix/uxproces.c
@@ -176,7 +176,12 @@ ForkAndExec(
}
}
- (void)execve(path, argv, envp);
+ if (envp) {
+ (void)execve(path, argv, envp);
+ } else {
+ /* Inherit the environment of the parent. */
+ (void)execv(path, argv);
+ }
/* Whoops! It returned. That's a bad sign. */
_exit(1);
}