Fix KillTheDoctor after r210725.
authorRafael Espindola <rafael.espindola@gmail.com>
Fri, 13 Jun 2014 15:01:11 +0000 (15:01 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Fri, 13 Jun 2014 15:01:11 +0000 (15:01 +0000)
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

utils/KillTheDoctor/KillTheDoctor.cpp

index 84f9b19f95044e38dee213fd50ab46e18e886c03..a85dac8ae85900787a70b3ce4af8fdec7c2d8204 100644 (file)
@@ -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...