git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101701
91177308-0d34-0410-b5e6-
96231b3b80d8
#include <spawn.h>
#endif
+extern char **environ;
+
namespace llvm {
using namespace sys;
#ifdef HAVE_POSIX_SPAWN
static bool RedirectIO_PS(const Path *Path, int FD, std::string *ErrMsg,
- posix_spawn_file_actions_t &FileActions) {
+ posix_spawn_file_actions_t &FileActions) {
if (Path == 0) // Noop
return false;
std::string File;
}
pid_t PID;
+ if (!envp) envp = (const char**)environ;
int Err = posix_spawn(&PID, path.c_str(), &FileActions,
/*attrp*/0, (char**)args, (char**)envp);