aboutsummaryrefslogtreecommitdiff
path: root/src/client/windows
diff options
context:
space:
mode:
authorthestig@chromium.org <thestig@chromium.org@4c0a9323-5329-0410-9bdc-e9ce6186880e>2013-12-09 21:59:48 +0000
committerthestig@chromium.org <thestig@chromium.org@4c0a9323-5329-0410-9bdc-e9ce6186880e>2013-12-09 21:59:48 +0000
commit8d22ec9227f4fd5c0cc2ae1fe8a09d07bfa08b2d (patch)
tree83234b447377bfa1a839e1f149156b87c0696850 /src/client/windows
parentAdd MMX detection when getting registers in Linux. (diff)
downloadbreakpad-8d22ec9227f4fd5c0cc2ae1fe8a09d07bfa08b2d.tar.xz
Fix Windows release build error due to unreferenced variables.
BUG=544 R=mark@chromium.org Review URL: https://breakpad.appspot.com/874002 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1249 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/client/windows')
-rw-r--r--src/client/windows/crash_generation/crash_generation_server.cc37
1 files changed, 15 insertions, 22 deletions
diff --git a/src/client/windows/crash_generation/crash_generation_server.cc b/src/client/windows/crash_generation/crash_generation_server.cc
index b98fb5e0..b4bb5c95 100644
--- a/src/client/windows/crash_generation/crash_generation_server.cc
+++ b/src/client/windows/crash_generation/crash_generation_server.cc
@@ -85,6 +85,15 @@ static bool IsClientRequestValid(const ProtocolMessage& msg) {
msg.assert_info != NULL);
}
+#ifdef _DEBUG
+static bool CheckForIOIncomplete(bool success) {
+ // We should never get an I/O incomplete since we should not execute this
+ // unless the operation has finished and the overlapped event is signaled. If
+ // we do get INCOMPLETE, we have a bug in our code.
+ return success ? false : (GetLastError() == ERROR_IO_INCOMPLETE);
+}
+#endif
+
CrashGenerationServer::CrashGenerationServer(
const std::wstring& pipe_name,
SECURITY_ATTRIBUTES* pipe_sec_attrs,
@@ -388,18 +397,13 @@ void CrashGenerationServer::HandleReadingState() {
&overlapped_,
&bytes_count,
FALSE) != FALSE;
- DWORD error_code = success ? ERROR_SUCCESS : GetLastError();
-
if (success && bytes_count == sizeof(ProtocolMessage)) {
EnterStateImmediately(IPC_SERVER_STATE_READ_DONE);
- } else {
- // We should never get an I/O incomplete since we should not execute this
- // unless the Read has finished and the overlapped event is signaled. If
- // we do get INCOMPLETE, we have a bug in our code.
- assert(error_code != ERROR_IO_INCOMPLETE);
-
- EnterStateImmediately(IPC_SERVER_STATE_DISCONNECTING);
+ return;
}
+
+ assert(!CheckForIOIncomplete(success));
+ EnterStateImmediately(IPC_SERVER_STATE_DISCONNECTING);
}
// When the server thread serving the client is in the READ_DONE state,
@@ -468,18 +472,12 @@ void CrashGenerationServer::HandleWritingState() {
&overlapped_,
&bytes_count,
FALSE) != FALSE;
- DWORD error_code = success ? ERROR_SUCCESS : GetLastError();
-
if (success) {
EnterStateImmediately(IPC_SERVER_STATE_WRITE_DONE);
return;
}
- // We should never get an I/O incomplete since we should not execute this
- // unless the Write has finished and the overlapped event is signaled. If
- // we do get INCOMPLETE, we have a bug in our code.
- assert(error_code != ERROR_IO_INCOMPLETE);
-
+ assert(!CheckForIOIncomplete(success));
EnterStateImmediately(IPC_SERVER_STATE_DISCONNECTING);
}
@@ -517,8 +515,6 @@ void CrashGenerationServer::HandleReadingAckState() {
&overlapped_,
&bytes_count,
FALSE) != FALSE;
- DWORD error_code = success ? ERROR_SUCCESS : GetLastError();
-
if (success) {
// The connection handshake with the client is now complete; perform
// the callback.
@@ -551,10 +547,7 @@ void CrashGenerationServer::HandleReadingAckState() {
}
}
} else {
- // We should never get an I/O incomplete since we should not execute this
- // unless the Read has finished and the overlapped event is signaled. If
- // we do get INCOMPLETE, we have a bug in our code.
- assert(error_code != ERROR_IO_INCOMPLETE);
+ assert(!CheckForIOIncomplete(success));
}
EnterStateImmediately(IPC_SERVER_STATE_DISCONNECTING);