Check thread param on posix_pthread_rename_np

This commit is contained in:
Stephen 2025-01-11 19:39:34 -06:00
parent 62bbad62fc
commit a01c912d8c

View File

@ -386,6 +386,9 @@ int PS4_SYSV_ABI posix_sched_get_priority_min() {
} }
int PS4_SYSV_ABI posix_pthread_rename_np(PthreadT thread, const char* name) { int PS4_SYSV_ABI posix_pthread_rename_np(PthreadT thread, const char* name) {
if (thread == nullptr) {
return POSIX_EINVAL;
}
LOG_INFO(Kernel_Pthread, "name = {}", name); LOG_INFO(Kernel_Pthread, "name = {}", name);
Common::SetThreadName(reinterpret_cast<void*>(thread->native_thr.GetHandle()), name); Common::SetThreadName(reinterpret_cast<void*>(thread->native_thr.GetHandle()), name);
thread->name = name; thread->name = name;