Add an explicit initialization to work around what appears to be a valgrind

false positive, at least on Darwin. I haven't filed this, but you can feel free.

llvm-svn: 115242
This commit is contained in:
Daniel Dunbar 2010-09-30 23:56:49 +00:00
parent b9b63ee031
commit 31158b583a
1 changed files with 3 additions and 1 deletions

View File

@ -212,7 +212,9 @@ Program::Execute(const Path &path, const char **args, const char **envp,
envp = const_cast<const char **>(*_NSGetEnviron());
#endif
pid_t PID;
// Explicitly initialized to prevent what appears to be a valgrind false
// positive.
pid_t PID = 0;
int Err = posix_spawn(&PID, path.c_str(), &FileActions, /*attrp*/0,
const_cast<char **>(args), const_cast<char **>(envp));