LibC: Fix futex return value handling
This commit is contained in:
@@ -57,8 +57,11 @@ int sem_timedwait(sem_t* __restrict sem, const struct timespec* __restrict absti
|
||||
}
|
||||
|
||||
const int op = FUTEX_WAIT | (sem->shared ? 0 : FUTEX_PRIVATE) | FUTEX_REALTIME;
|
||||
if (futex(op, &sem->value, expected, abstime) == -1 && (errno == EINTR || errno == ETIMEDOUT))
|
||||
if (const int err = futex(op, &sem->value, expected, abstime); err != EAGAIN)
|
||||
{
|
||||
errno = err;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user