From ffa44050835fd75a4b6fbf3356034b07f0456b83 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Thu, 26 Nov 2020 11:51:26 +0100 Subject: LibPthread: Fix broken EINVAL check in pthread_attr_setdetachstate() Also fix up some misleading error messages in the 'tt' test program. --- Libraries/LibPthread/pthread.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Libraries/LibPthread') diff --git a/Libraries/LibPthread/pthread.cpp b/Libraries/LibPthread/pthread.cpp index 4c69f7b6aa..75109fc928 100644 --- a/Libraries/LibPthread/pthread.cpp +++ b/Libraries/LibPthread/pthread.cpp @@ -278,7 +278,7 @@ int pthread_attr_setdetachstate(pthread_attr_t* attributes, int detach_state) if (!attributes_impl) return EINVAL; - if ((PTHREAD_CREATE_JOINABLE != detach_state) || PTHREAD_CREATE_DETACHED != detach_state) + if (detach_state != PTHREAD_CREATE_JOINABLE && detach_state != PTHREAD_CREATE_DETACHED) return EINVAL; attributes_impl->m_detach_state = detach_state; -- cgit v1.2.3