From 3ff11818ab7c9eaa7b5b165b1e3c6332896ce079 Mon Sep 17 00:00:00 2001 From: squidbus <175574877+squidbus@users.noreply.github.com> Date: Tue, 16 Jul 2024 04:40:43 -0700 Subject: [PATCH] Return EBUSY from sceKernelPollEventFlag instead of ETIMEDOUT. --- src/core/libraries/kernel/event_flag/event_flag_obj.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/core/libraries/kernel/event_flag/event_flag_obj.cpp b/src/core/libraries/kernel/event_flag/event_flag_obj.cpp index 46429d40..fe0f34b8 100644 --- a/src/core/libraries/kernel/event_flag/event_flag_obj.cpp +++ b/src/core/libraries/kernel/event_flag/event_flag_obj.cpp @@ -73,7 +73,12 @@ int EventFlagInternal::Wait(u64 bits, WaitMode wait_mode, ClearMode clear_mode, int EventFlagInternal::Poll(u64 bits, WaitMode wait_mode, ClearMode clear_mode, u64* result) { u32 micros = 0; - return Wait(bits, wait_mode, clear_mode, result, µs); + auto ret = Wait(bits, wait_mode, clear_mode, result, µs); + if (ret == ORBIS_KERNEL_ERROR_ETIMEDOUT) { + // Poll returns EBUSY instead. + ret = ORBIS_KERNEL_ERROR_EBUSY; + } + return ret; } void EventFlagInternal::Set(u64 bits) {