mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-28 19:25:00 +00:00
Fix linux build. posix_spawn doesn't inherit the environment by default.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101701 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -34,6 +34,8 @@
|
|||||||
#include <spawn.h>
|
#include <spawn.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
extern char **environ;
|
||||||
|
|
||||||
namespace llvm {
|
namespace llvm {
|
||||||
using namespace sys;
|
using namespace sys;
|
||||||
|
|
||||||
@@ -200,6 +202,7 @@ Program::Execute(const Path &path, const char **args, const char **envp,
|
|||||||
}
|
}
|
||||||
|
|
||||||
pid_t PID;
|
pid_t PID;
|
||||||
|
if (!envp) envp = (const char**)environ;
|
||||||
int Err = posix_spawn(&PID, path.c_str(), &FileActions,
|
int Err = posix_spawn(&PID, path.c_str(), &FileActions,
|
||||||
/*attrp*/0, (char**)args, (char**)envp);
|
/*attrp*/0, (char**)args, (char**)envp);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user