From e3b349bcc18536692989b5fe0810f9dd699a7184 Mon Sep 17 00:00:00 2001 From: Colin Ward Date: Wed, 10 Jul 2024 05:06:32 +0900 Subject: [PATCH] Always re-enable blocking mode Fixes a logic error whereby blocking mode was only re-enabled in the RRemoteFactory::checkConnection() method if the call to recv() succeeded. --- RemoteFactory.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/RemoteFactory.cpp b/RemoteFactory.cpp index 5f73dc0..dc59cec 100644 --- a/RemoteFactory.cpp +++ b/RemoteFactory.cpp @@ -137,7 +137,6 @@ void RRemoteFactory::close() * @return KErrNone if successful, otherwise one of the errors returned by RRemoteFactory::openRemote() */ -// TODO: CAW - Move this stuff into RSocket? int RRemoteFactory::checkConnection() { int retVal = KErrNone; @@ -182,12 +181,9 @@ int RRemoteFactory::checkConnection() char buffer[1]; result = recv(m_socket.m_socket, buffer, 1, 0); - if (result != -1) + if (fcntl(m_socket.m_socket, F_SETFL, flags) == -1) { - if (fcntl(m_socket.m_socket, F_SETFL, flags) == -1) - { - result = -1; - } + result = -1; } } }