1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 06:48:12 +00:00

LibPthread: Fix broken EINVAL check in pthread_attr_setdetachstate()

Also fix up some misleading error messages in the 'tt' test program.
This commit is contained in:
Andreas Kling 2020-11-26 11:51:26 +01:00
parent a5e560ee49
commit ffa4405083
2 changed files with 4 additions and 4 deletions

View file

@ -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;