Index: util/win/registration_protocol_win.cc |
diff --git a/util/win/registration_protocol_win.cc b/util/win/registration_protocol_win.cc |
index 3e0fdf213985a4bc81ae295bd3377140463045da..09c7f941e6146332e6ebd3ad7d520c2007bda6f8 100644 |
--- a/util/win/registration_protocol_win.cc |
+++ b/util/win/registration_protocol_win.cc |
@@ -35,7 +35,15 @@ bool SendToCrashHandlerServer(const base::string16& pipe_name, |
SECURITY_SQOS_PRESENT | SECURITY_IDENTIFICATION, |
nullptr)); |
if (!pipe.is_valid()) { |
- Sleep(10); |
+ if (GetLastError() != ERROR_PIPE_BUSY) { |
+ PLOG(ERROR) << "CreateFile"; |
+ return false; |
+ } |
+ |
+ if (!WaitNamedPipe(pipe_name.c_str(), 1000)) { |
Mark Mentovai
2015/11/06 23:03:34
We don’t want to do this at all on the last try.
scottmg
2015/11/06 23:10:59
Done.
|
+ PLOG(ERROR) << "WaitNamedPipe"; |
Mark Mentovai
2015/11/06 23:03:34
If GetLastError() is ERROR_SEM_TIMEOUT, we should
scottmg
2015/11/06 23:10:59
Done.
|
+ return false; |
+ } |
--tries; |
continue; |
} |