summaryrefslogtreecommitdiffstats
path: root/lib/libpthread
diff options
context:
space:
mode:
authord <d@openbsd.org>1998-12-18 14:34:31 +0000
committerd <d@openbsd.org>1998-12-18 14:34:31 +0000
commit1780682c2d2432ab66b7788b9add8f7ec7b9e2da (patch)
tree53471b91ef363751c5cbb2eee5e5920bb4d28ed8 /lib/libpthread
parentmake plist: do not add files from just installed ports (we wepend on) to PLIST. (diff)
downloadwireguard-openbsd-1780682c2d2432ab66b7788b9add8f7ec7b9e2da.tar.xz
wireguard-openbsd-1780682c2d2432ab66b7788b9add8f7ec7b9e2da.zip
comply with posix when double-unlocking a mutex
Diffstat (limited to 'lib/libpthread')
-rw-r--r--lib/libpthread/uthread/uthread_mutex.c4
1 files changed, 2 insertions, 2 deletions
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