LibC: Fix futex return value handling

This commit is contained in:
2026-07-20 06:58:30 +03:00
parent a9cf0134b7
commit 64523b6c70
2 changed files with 10 additions and 6 deletions
+4 -1
View File
@@ -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;
}
}
}