aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Support/Windows/Program.inc
diff options
context:
space:
mode:
authorAndrew Trick <atrick@apple.com>2011-05-21 00:56:46 +0000
committerAndrew Trick <atrick@apple.com>2011-05-21 00:56:46 +0000
commitdc5948d47205fd05184a25251e128db6a47b25c2 (patch)
tree79eabc660d9d50197ac5b3182ac793e88b9dbc82 /lib/Support/Windows/Program.inc
parent5c2256a5719172273eaef198f92d8af924ff8623 (diff)
downloadexternal_llvm-dc5948d47205fd05184a25251e128db6a47b25c2.zip
external_llvm-dc5948d47205fd05184a25251e128db6a47b25c2.tar.gz
external_llvm-dc5948d47205fd05184a25251e128db6a47b25c2.tar.bz2
Have Program::Wait return -2 for crashed and timeouts instead of embedding
info in the error message. Per Dan's request. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131780 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/Windows/Program.inc')
-rw-r--r--lib/Support/Windows/Program.inc9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/Support/Windows/Program.inc b/lib/Support/Windows/Program.inc
index b685bb8..e486e6e 100644
--- a/lib/Support/Windows/Program.inc
+++ b/lib/Support/Windows/Program.inc
@@ -332,8 +332,7 @@ Program::Execute(const Path& path,
int
Program::Wait(const Path &path,
unsigned secondsToWait,
- std::string* ErrMsg,
- const char* /*SignalPrefix*/) {
+ std::string* ErrMsg) {
if (Data_ == 0) {
MakeErrMsg(ErrMsg, "Process not started!");
return -1;
@@ -350,7 +349,8 @@ Program::Wait(const Path &path,
if (WaitForSingleObject(hProcess, millisecondsToWait) == WAIT_TIMEOUT) {
if (!TerminateProcess(hProcess, 1)) {
MakeErrMsg(ErrMsg, "Failed to terminate timed-out program.");
- return -1;
+ // -2 indicates a crash or timeout as opposed to failure to execute.
+ return -2;
}
WaitForSingleObject(hProcess, INFINITE);
}
@@ -363,7 +363,8 @@ Program::Wait(const Path &path,
if (!rc) {
SetLastError(err);
MakeErrMsg(ErrMsg, "Failed getting status for program.");
- return -1;
+ // -2 indicates a crash or timeout as opposed to failure to execute.
+ return -2;
}
return status;