aboutsummaryrefslogtreecommitdiff
path: root/lib/Support
diff options
context:
space:
mode:
authorChad Rosier <mcrosier@apple.com>2013-03-26 23:35:00 +0000
committerChad Rosier <mcrosier@apple.com>2013-03-26 23:35:00 +0000
commit847e36fb60ed4c9fa08215df4fddbe085bbad87a (patch)
tree11f4d357ff712ca60be1cf7bd0a6d3dbce03f29b /lib/Support
parent39c41c3c93e0d223792acb093adce21a714b01c6 (diff)
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178087 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support')
-rw-r--r--lib/Support/Program.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/Support/Program.cpp b/lib/Support/Program.cpp
index 75bc282d9b..201d5c0d30 100644
--- a/lib/Support/Program.cpp
+++ b/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