Improve parameter checks for posix_pthread_rename_np (#2391)

This commit is contained in:
Stephen Miller
2025-02-09 15:50:59 -06:00
committed by GitHub
parent 04fe3a79b9
commit 22357f70c2

View File

@@ -389,6 +389,9 @@ int PS4_SYSV_ABI posix_pthread_rename_np(PthreadT thread, const char* name) {
if (thread == nullptr) { if (thread == nullptr) {
return POSIX_EINVAL; return POSIX_EINVAL;
} }
if (name == nullptr) {
return 0;
}
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;