pthread: Return get_errno instead the hardcode value

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I1830a473da179d3a1280d3482b0f000ce72de107
This commit is contained in:
Xiang Xiao
2021-01-28 11:31:40 -03:00
committed by Alan Carvalho de Assis
parent bf384a7e33
commit 8e6cdd0375
3 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -113,7 +113,7 @@ int pthread_barrier_wait(FAR pthread_barrier_t *barrier)
if (ret != OK)
{
sched_unlock();
return EINVAL;
return get_errno();
}
/* If the number of waiters would be equal to the count, then we are done */
+1 -1
View File
@@ -95,7 +95,7 @@ int pthread_cond_destroy(FAR pthread_cond_t *cond)
}
else if (sem_destroy(&cond->sem) != OK)
{
ret = EINVAL;
ret = get_errno();
}
}
}
+2 -2
View File
@@ -80,9 +80,9 @@ int pthread_cond_init(FAR pthread_cond_t *cond,
* initial count = 0
*/
else if (sem_init((FAR sem_t *)&cond->sem, 0, 0) != OK)
else if (sem_init(&cond->sem, 0, 0) != OK)
{
ret = EINVAL;
ret = get_errno();
}
else
{