about summary refs log tree commit diff
path: root/src/thread/pthread_mutex_trylock.c
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2011-03-16 16:25:00 -0400
committerRich Felker <dalias@aerifal.cx>2011-03-16 16:25:00 -0400
commitd4f9e0b3642a81d07c95302cd9aa0dcaf7de1a05 (patch)
tree8bb9017678027a5f7c0b461fc9e246d34d0ebd1d /src/thread/pthread_mutex_trylock.c
parent29fae65780f4c5ccda3758828da7a83073297ccc (diff)
downloadmusl-d4f9e0b3642a81d07c95302cd9aa0dcaf7de1a05.tar.gz
musl-d4f9e0b3642a81d07c95302cd9aa0dcaf7de1a05.tar.xz
musl-d4f9e0b3642a81d07c95302cd9aa0dcaf7de1a05.zip
correct error returns for error-checking mutexes
Diffstat (limited to 'src/thread/pthread_mutex_trylock.c')
-rw-r--r--src/thread/pthread_mutex_trylock.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/thread/pthread_mutex_trylock.c b/src/thread/pthread_mutex_trylock.c
index 2dad7bbf..25b9e869 100644
--- a/src/thread/pthread_mutex_trylock.c
+++ b/src/thread/pthread_mutex_trylock.c
@@ -11,7 +11,7 @@ int pthread_mutex_trylock(pthread_mutex_t *m)
 
 	if (m->_m_owner == tid) {
 		if (m->_m_type != PTHREAD_MUTEX_RECURSIVE)
-			return EDEADLK;
+			return EBUSY;
 		if ((unsigned)m->_m_count >= INT_MAX) return EAGAIN;
 		m->_m_count++;
 		return 0;