From e9503131556656d7ae0ad583b9d9ed81755a3746 Mon Sep 17 00:00:00 2001 From: Graydon Hoare Date: Wed, 28 Mar 2012 20:28:35 -0700 Subject: [PATCH] Remove execvpe use in general, it seems pointless and non-portable. --- src/rt/rust_run_program.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/rt/rust_run_program.cpp b/src/rt/rust_run_program.cpp index 313ab74995a..8390c8e4723 100644 --- a/src/rt/rust_run_program.cpp +++ b/src/rt/rust_run_program.cpp @@ -163,19 +163,15 @@ rust_run_program(const char* argv[], assert(!result && "chdir failed"); } -#ifdef __APPLE__ if (envp) { +#ifdef __APPLE__ *_NSGetEnviron() = (char **)envp; - } - execvp(argv[0], (char * const *)argv); -#elif __FreeBSD__ || (defined(__linux__) && defined(RUST_SNAPSHOT)) - 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); + environ = (char **)envp; #endif + } + execvp(argv[0], (char * const *)argv); exit(1); }