diff options
author | Chad Rosier <mcrosier@apple.com> | 2013-03-26 23:35:00 +0000 |
---|---|---|
committer | Chad Rosier <mcrosier@apple.com> | 2013-03-26 23:35:00 +0000 |
commit | 654190a12d9c97bcd6cf81b0bb4e5c474bb3393d (patch) | |
tree | 13fc9c4504073d8f20113696fe70120260181e37 /llvm/lib/Support/Program.cpp | |
parent | ab003df656f9f0554ec83e52d55ddf76e1c8145e (diff) | |
download | bcm5719-llvm-654190a12d9c97bcd6cf81b0bb4e5c474bb3393d.tar.gz bcm5719-llvm-654190a12d9c97bcd6cf81b0bb4e5c474bb3393d.zip |
Add a boolean parameter to the ExecuteAndWait static function to indicated
if execution failed. ExecuteAndWait returns -1 upon an execution failure, but
checking the return value isn't sufficient because the wait command may
return -1 as well. This new parameter is to be used by the clang driver in a
subsequent commit.
Part of rdar://13362359
llvm-svn: 178087
Diffstat (limited to 'llvm/lib/Support/Program.cpp')
-rw-r--r-- | llvm/lib/Support/Program.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/llvm/lib/Support/Program.cpp b/llvm/lib/Support/Program.cpp index 75bc282d9bd..201d5c0d305 100644 --- a/llvm/lib/Support/Program.cpp +++ b/llvm/lib/Support/Program.cpp @@ -29,12 +29,15 @@ Program::ExecuteAndWait(const Path& path, const Path** redirects, unsigned secondsToWait, unsigned memoryLimit, - std::string* ErrMsg) { + std::string* ErrMsg, + bool *ExecutionFailed) { Program prg; - if (prg.Execute(path, args, envp, redirects, memoryLimit, ErrMsg)) + if (prg.Execute(path, args, envp, redirects, memoryLimit, ErrMsg)) { + if (ExecutionFailed) *ExecutionFailed = false; return prg.Wait(path, secondsToWait, ErrMsg); - else - return -1; + } + if (ExecutionFailed) *ExecutionFailed = true; + return -1; } void |