diff --git a/src/system/libroot/posix/pthread/pthread.cpp b/src/system/libroot/posix/pthread/pthread.cpp index 8ca7831d33..b28b0646d3 100644 --- a/src/system/libroot/posix/pthread/pthread.cpp +++ b/src/system/libroot/posix/pthread/pthread.cpp @@ -325,6 +325,8 @@ pthread_getname_np(pthread_t thread, char* buffer, size_t length) status_t status = _kern_get_thread_info(thread->id, &info); if (status == B_BAD_THREAD_ID) return ESRCH; + if (status < B_OK) + return status; if (strlcpy(buffer, info.name, length) >= length) return ERANGE; return 0;