kernel: POSIX: Fixing return value of POSIX APIs on error.

As per IEEE 1003.1 POSIX APIs should return ERROR_CODE on error.
But currently these are returning -ERROR_CODE instead of ERROR_CODE.
So fixing the return value.

Signed-off-by: Youvedeep Singh <youvedeep.singh@intel.com>
This commit is contained in:
Youvedeep Singh 2018-02-08 08:50:06 +05:30 committed by Anas Nashif
commit 325abfbcf4
3 changed files with 3 additions and 3 deletions

View file

@ -193,7 +193,7 @@ static inline int pthread_mutex_timedlock(pthread_mutex_t *m,
{
int ret = k_sem_take(m->sem, _ts_to_ms(to));
return ret == -EAGAIN ? -ETIMEDOUT : ret;
return ret == 0 ? ret : ETIMEDOUT;
}
/**