From 4e014f996bd964a7cef79905187e003dae939f4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Wed, 28 Feb 2018 15:56:03 +0100 Subject: [PATCH] IOS: Fix invalid FD being returned after an open Fixes a regression introduced by 80b1bf13c2. The return value for open replies should be overwritten with the new file descriptor. --- Source/Core/Core/IOS/IOS.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Source/Core/Core/IOS/IOS.cpp b/Source/Core/Core/IOS/IOS.cpp index 722af814f1..a41effe7b7 100644 --- a/Source/Core/Core/IOS/IOS.cpp +++ b/Source/Core/Core/IOS/IOS.cpp @@ -500,9 +500,12 @@ IPCCommandResult Kernel::OpenDevice(OpenRequest& request) return Device::Device::GetDefaultReply(IPC_ENOENT); } - const IPCCommandResult result = device->Open(request); + IPCCommandResult result = device->Open(request); if (result.return_value >= IPC_SUCCESS) + { m_fdmap[new_fd] = device; + result.return_value = new_fd; + } return result; }