[llvm] r210910 - Fix KillTheDoctor after r210725.

Rafael Espindola rafael.espindola at gmail.com
Fri Jun 13 08:01:11 PDT 2014


Author: rafael
Date: Fri Jun 13 10:01:11 2014
New Revision: 210910

URL: http://llvm.org/viewvc/llvm-project?rev=210910&view=rev
Log:
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.

Modified:
    llvm/trunk/utils/KillTheDoctor/KillTheDoctor.cpp

Modified: llvm/trunk/utils/KillTheDoctor/KillTheDoctor.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/KillTheDoctor/KillTheDoctor.cpp?rev=210910&r1=210909&r2=210910&view=diff
==============================================================================
--- llvm/trunk/utils/KillTheDoctor/KillTheDoctor.cpp (original)
+++ llvm/trunk/utils/KillTheDoctor/KillTheDoctor.cpp Fri Jun 13 10:01:11 2014
@@ -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...





More information about the llvm-commits mailing list