mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-01-19 05:53:31 +08:00
[lwp] 修复错误码误用 (#7906)
This commit is contained in:
parent
a6fcb4f8a1
commit
d5c9dc09a0
@ -189,7 +189,7 @@ static int _pthread_mutex_init(void *umutex)
|
||||
if (lock_ret != RT_EOK)
|
||||
{
|
||||
rt_set_errno(EAGAIN);
|
||||
return -EINTR;
|
||||
return -EAGAIN;
|
||||
}
|
||||
|
||||
lwp = lwp_self();
|
||||
@ -262,7 +262,7 @@ static int _pthread_mutex_lock_timeout(void *umutex, struct timespec *timeout)
|
||||
lock_ret = rt_mutex_take_interruptible(&_pmutex_lock, RT_WAITING_FOREVER);
|
||||
if (lock_ret != RT_EOK)
|
||||
{
|
||||
rt_set_errno(EAGAIN);
|
||||
rt_set_errno(EINTR);
|
||||
return -EINTR;
|
||||
}
|
||||
|
||||
@ -323,6 +323,11 @@ static int _pthread_mutex_lock_timeout(void *umutex, struct timespec *timeout)
|
||||
return -ETIMEDOUT;
|
||||
}
|
||||
}
|
||||
else if (lock_ret == -RT_EINTR)
|
||||
{
|
||||
rt_set_errno(EINTR);
|
||||
return -EINTR;
|
||||
}
|
||||
else
|
||||
{
|
||||
rt_set_errno(EAGAIN);
|
||||
@ -343,7 +348,7 @@ static int _pthread_mutex_unlock(void *umutex)
|
||||
if (lock_ret != RT_EOK)
|
||||
{
|
||||
rt_set_errno(EAGAIN);
|
||||
return -EINTR;
|
||||
return -EAGAIN;
|
||||
}
|
||||
|
||||
lwp = lwp_self();
|
||||
@ -385,7 +390,7 @@ static int _pthread_mutex_unlock(void *umutex)
|
||||
if (lock_ret != RT_EOK)
|
||||
{
|
||||
rt_set_errno(EPERM);
|
||||
return -EAGAIN;
|
||||
return -EPERM;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@ -400,7 +405,7 @@ static int _pthread_mutex_destroy(void *umutex)
|
||||
if (lock_ret != RT_EOK)
|
||||
{
|
||||
rt_set_errno(EAGAIN);
|
||||
return -EINTR;
|
||||
return -EAGAIN;
|
||||
}
|
||||
|
||||
lwp = lwp_self();
|
||||
|
Loading…
x
Reference in New Issue
Block a user