From 56b7581ade8186eef18b64cd83f31af7bf7ea5d4 Mon Sep 17 00:00:00 2001 From: eladash Date: Fri, 25 Jan 2019 09:56:17 +0200 Subject: [PATCH] Return error code in sys_ppu_thread_get_join_state --- rpcs3/Emu/Cell/lv2/sys_ppu_thread.cpp | 8 +++++++- rpcs3/Emu/Cell/lv2/sys_ppu_thread.h | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/rpcs3/Emu/Cell/lv2/sys_ppu_thread.cpp b/rpcs3/Emu/Cell/lv2/sys_ppu_thread.cpp index 1f5a0f36bc..da1fbcba44 100644 --- a/rpcs3/Emu/Cell/lv2/sys_ppu_thread.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_ppu_thread.cpp @@ -188,11 +188,17 @@ error_code sys_ppu_thread_detach(u32 thread_id) return CELL_OK; } -void sys_ppu_thread_get_join_state(ppu_thread& ppu, vm::ptr isjoinable) +error_code sys_ppu_thread_get_join_state(ppu_thread& ppu, vm::ptr isjoinable) { sys_ppu_thread.trace("sys_ppu_thread_get_join_state(isjoinable=*0x%x)", isjoinable); + if (!isjoinable) + { + return CELL_EFAULT; + } + *isjoinable = ppu.joiner != -1; + return CELL_OK; } error_code sys_ppu_thread_set_priority(ppu_thread& ppu, u32 thread_id, s32 prio) diff --git a/rpcs3/Emu/Cell/lv2/sys_ppu_thread.h b/rpcs3/Emu/Cell/lv2/sys_ppu_thread.h index e9d6ed207f..82fb9f5d92 100644 --- a/rpcs3/Emu/Cell/lv2/sys_ppu_thread.h +++ b/rpcs3/Emu/Cell/lv2/sys_ppu_thread.h @@ -58,7 +58,7 @@ void _sys_ppu_thread_exit(ppu_thread& ppu, u64 errorcode); void sys_ppu_thread_yield(ppu_thread& ppu); error_code sys_ppu_thread_join(ppu_thread& ppu, u32 thread_id, vm::ptr vptr); error_code sys_ppu_thread_detach(u32 thread_id); -void sys_ppu_thread_get_join_state(ppu_thread& ppu, vm::ptr isjoinable); +error_code sys_ppu_thread_get_join_state(ppu_thread& ppu, vm::ptr isjoinable); // Error code is ignored by the library error_code sys_ppu_thread_set_priority(ppu_thread& ppu, u32 thread_id, s32 prio); error_code sys_ppu_thread_get_priority(u32 thread_id, vm::ptr priop); error_code sys_ppu_thread_get_stack_information(ppu_thread& ppu, vm::ptr sp);