diff options
author | wtc%netscape.com <devnull@localhost> | 1998-09-20 00:21:35 +0000 |
---|---|---|
committer | wtc%netscape.com <devnull@localhost> | 1998-09-20 00:21:35 +0000 |
commit | f20edc3cdc83adee477b6a6b50aaef20176f0a45 (patch) | |
tree | 527a76220871e0ef4d081555eca7bbb59cebcef6 | |
parent | 3627e09889e95d9408dd1373791041d7bcdd78f0 (diff) | |
download | nspr-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.c | 7 |
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); } |