Skip to content

Commit

Permalink
pthread_conddestroy: Fix return value, if sem_getvalue fails
Browse files Browse the repository at this point in the history
sem_getvalue returns ERROR and sets errno if it fails, we don't want to
return OK in this case, we want to return the non-negated error number.
  • Loading branch information
pussuw committed Jan 16, 2025
1 parent 61f0c97 commit ddc42f3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libs/libc/pthread/pthread_conddestroy.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ int pthread_cond_destroy(FAR pthread_cond_t *cond)
ret = sem_getvalue(&cond->sem, &sval);
if (ret < 0)
{
ret = -ret;
ret = get_errno();
}
else
{
Expand Down

0 comments on commit ddc42f3

Please sign in to comment.