pthread: Return get_errno instead the hardcode value
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com> Change-Id: I1830a473da179d3a1280d3482b0f000ce72de107
This commit is contained in:
parent
bf384a7e33
commit
8e6cdd0375
@ -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 */
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user