summaryrefslogtreecommitdiff
path: root/utils/KillTheDoctor/KillTheDoctor.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2014-06-13 15:01:11 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2014-06-13 15:01:11 +0000
commit087c5bc9f114a076f75617d5685dcc23d950f855 (patch)
treea6ee8bb51dc734290900f4081cdbc42a58b4d07c /utils/KillTheDoctor/KillTheDoctor.cpp
parente1a9d504a3fd8e2544b352224bc719d52c070ceb (diff)
downloadllvm-087c5bc9f114a076f75617d5685dcc23d950f855.tar.gz
llvm-087c5bc9f114a076f75617d5685dcc23d950f855.tar.bz2
llvm-087c5bc9f114a076f75617d5685dcc23d950f855.tar.xz
Fix KillTheDoctor after r210725.
We don't map these windows errors to generic ones since errc::timed_out is not defined on mingw. Just use the raw windows error value. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210910 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/KillTheDoctor/KillTheDoctor.cpp')
-rw-r--r--utils/KillTheDoctor/KillTheDoctor.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/utils/KillTheDoctor/KillTheDoctor.cpp b/utils/KillTheDoctor/KillTheDoctor.cpp
index 84f9b19f95..a85dac8ae8 100644
--- a/utils/KillTheDoctor/KillTheDoctor.cpp
+++ b/utils/KillTheDoctor/KillTheDoctor.cpp
@@ -37,6 +37,7 @@
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/Twine.h"
#include "llvm/Support/CommandLine.h"
+#include "llvm/Support/Errc.h"
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/PrettyStackTrace.h"
#include "llvm/Support/Signals.h"
@@ -424,9 +425,10 @@ int main(int argc, char **argv) {
success = WaitForDebugEvent(&DebugEvent, TimeLeft);
if (!success) {
- ec = windows_error(::GetLastError());
+ DWORD LastError = ::GetLastError();
+ ec = windows_error(LastError);
- if (ec == std::errc::timed_out) {
+ if (LastError == ERROR_SEM_TIMEOUT || LastError == WSAETIMEDOUT) {
errs() << ToolName << ": Process timed out.\n";
::TerminateProcess(ProcessInfo.hProcess, -1);
// Otherwise other stuff starts failing...