From 3597650f221036deb382d4e8812e717014619eee Mon Sep 17 00:00:00 2001 From: bunnei Date: Tue, 31 Oct 2017 19:30:05 -0400 Subject: service: Return proper result code for IPC::CommandType::Close. --- src/core/hle/kernel/hle_ipc.h | 2 +- src/core/hle/kernel/server_session.cpp | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'src/core/hle/kernel') diff --git a/src/core/hle/kernel/hle_ipc.h b/src/core/hle/kernel/hle_ipc.h index b58e57b14..bf8cfc2a3 100644 --- a/src/core/hle/kernel/hle_ipc.h +++ b/src/core/hle/kernel/hle_ipc.h @@ -40,7 +40,7 @@ public: * this request (ServerSession, Originator thread, Translated command buffer, etc). * @returns ResultCode the result code of the translate operation. */ - virtual void HandleSyncRequest(SharedPtr server_session) = 0; + virtual ResultCode HandleSyncRequest(SharedPtr server_session) = 0; /** * Signals that a client has just connected to this HLE handler and keeps the diff --git a/src/core/hle/kernel/server_session.cpp b/src/core/hle/kernel/server_session.cpp index 337896abf..68e5cc2b7 100644 --- a/src/core/hle/kernel/server_session.cpp +++ b/src/core/hle/kernel/server_session.cpp @@ -60,12 +60,13 @@ ResultCode ServerSession::HandleSyncRequest(SharedPtr thread) { // similar. // If this ServerSession has an associated HLE handler, forward the request to it. + ResultCode result{RESULT_SUCCESS}; if (hle_handler != nullptr) { // Attempt to translate the incoming request's command buffer. - ResultCode result = TranslateHLERequest(this); - if (result.IsError()) - return result; - hle_handler->HandleSyncRequest(SharedPtr(this)); + ResultCode translate_result = TranslateHLERequest(this); + if (translate_result.IsError()) + return translate_result; + result = hle_handler->HandleSyncRequest(SharedPtr(this)); // TODO(Subv): Translate the response command buffer. } else { // Add the thread to the list of threads that have issued a sync request with this @@ -76,7 +77,7 @@ ResultCode ServerSession::HandleSyncRequest(SharedPtr thread) { // If this ServerSession does not have an HLE implementation, just wake up the threads waiting // on it. WakeupAllWaitingThreads(); - return RESULT_SUCCESS; + return result; } ServerSession::SessionPair ServerSession::CreateSessionPair(const std::string& name, -- cgit v1.2.3