diff options
Diffstat (limited to 'src/rt/rust_run_program.cpp')
| -rw-r--r-- | src/rt/rust_run_program.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/rt/rust_run_program.cpp b/src/rt/rust_run_program.cpp index a1a9e8d6189..7ccecb2f99a 100644 --- a/src/rt/rust_run_program.cpp +++ b/src/rt/rust_run_program.cpp @@ -136,6 +136,10 @@ rust_process_wait(int proc) { #include <unistd.h> #include <termios.h> +#ifdef __FreeBSD__ +extern char **environ; +#endif + extern "C" CDECL int rust_run_program(const char* argv[], void* envp, @@ -164,6 +168,9 @@ rust_run_program(const char* argv[], *_NSGetEnviron() = (char **)envp; } execvp(argv[0], (char * const *)argv); +#elif __FreeBSD__ + if (envp) { environ = (char **)envp; } + execvp(argv[0], (char * const *)argv); #else if (!envp) { envp = environ; } execvpe(argv[0], (char * const *)argv, (char * const *)envp); |
