From 345e105afda5ac15a42b41da7916b3d4451c19f3 Mon Sep 17 00:00:00 2001 From: Kazuhiro Fujieda Date: Thu, 21 Jul 2011 09:58:06 +0900 Subject: [PATCH] Make CXkeymacsApp::SendIPCMessage retry to send a message. --- xkeymacs/xkeymacs.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xkeymacs/xkeymacs.cpp b/xkeymacs/xkeymacs.cpp index 3da6dc4..555226f 100644 --- a/xkeymacs/xkeymacs.cpp +++ b/xkeymacs/xkeymacs.cpp @@ -125,7 +125,10 @@ BOOL CXkeymacsApp::SendIPCMessage(DWORD msg) if (!m_bIsWow64) return TRUE; DWORD ack, read; - return CallNamedPipe(IPC_PIPE, &msg, sizeof(msg), &ack, sizeof(DWORD), &read, NMPWAIT_WAIT_FOREVER); + for (int i = 0; i < 10; Sleep(100), ++i) + if (CallNamedPipe(IPC_PIPE, &msg, sizeof(msg), &ack, sizeof(DWORD), &read, NMPWAIT_WAIT_FOREVER)) + return TRUE; + return FALSE; } int CXkeymacsApp::ExitInstance() -- 2.11.0