summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/libc_r/uthread/uthread_mutex.c4
-rw-r--r--lib/libpthread/uthread/uthread_mutex.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/libc_r/uthread/uthread_mutex.c b/lib/libc_r/uthread/uthread_mutex.c
index d3801f1750c..062c5d7896b 100644
--- a/lib/libc_r/uthread/uthread_mutex.c
+++ b/lib/libc_r/uthread/uthread_mutex.c
@@ -360,8 +360,8 @@ pthread_mutex_unlock(pthread_mutex_t * mutex)
case PTHREAD_MUTEX_ERRORCHECK:
/* Check if the running thread is not the owner of the mutex: */
if ((*mutex)->m_owner != _thread_run) {
- /* Return an invalid argument error: */
- ret = (*mutex)->m_owner ? EPERM : EINVAL;
+ /* This thread doesn't have permission: */
+ ret = EPERM;
}
/*
* Get the next thread from the queue of threads waiting on
diff --git a/lib/libpthread/uthread/uthread_mutex.c b/lib/libpthread/uthread/uthread_mutex.c
index d3801f1750c..062c5d7896b 100644
--- a/lib/libpthread/uthread/uthread_mutex.c
+++ b/lib/libpthread/uthread/uthread_mutex.c
@@ -360,8 +360,8 @@ pthread_mutex_unlock(pthread_mutex_t * mutex)
case PTHREAD_MUTEX_ERRORCHECK:
/* Check if the running thread is not the owner of the mutex: */
if ((*mutex)->m_owner != _thread_run) {
- /* Return an invalid argument error: */
- ret = (*mutex)->m_owner ? EPERM : EINVAL;
+ /* This thread doesn't have permission: */
+ ret = EPERM;
}
/*
* Get the next thread from the queue of threads waiting on