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.

llvm-svn: 210910
This commit is contained in:
Rafael Espindola 2014-06-13 15:01:11 +00:00
parent 6bf04e4512
commit dbe027a9ed
1 changed files with 4 additions and 2 deletions

View 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...