summaryrefslogtreecommitdiffstats
path: root/lib/libthr
diff options
context:
space:
mode:
authordavidxu <davidxu@FreeBSD.org>2008-03-20 08:27:14 +0000
committerdavidxu <davidxu@FreeBSD.org>2008-03-20 08:27:14 +0000
commit1bc96ca9dccdf3b6e9e28126ca786c1334617b96 (patch)
treea5c8782a2e82af510b8374019ff1eb9ec993de98 /lib/libthr
parent56b72c6a35236042881207d3386f03131168eea0 (diff)
downloadFreeBSD-src-1bc96ca9dccdf3b6e9e28126ca786c1334617b96.zip
FreeBSD-src-1bc96ca9dccdf3b6e9e28126ca786c1334617b96.tar.gz
Make pthread_mutexattr_settype to return error number directly and
conformant to POSIX specification. Bug reported by: modelnine at modelnine dt org
Diffstat (limited to 'lib/libthr')
-rw-r--r--lib/libthr/thread/thr_mutexattr.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/libthr/thread/thr_mutexattr.c b/lib/libthr/thread/thr_mutexattr.c
index c7bdde2..9013c82 100644
--- a/lib/libthr/thread/thr_mutexattr.c
+++ b/lib/libthr/thread/thr_mutexattr.c
@@ -132,8 +132,7 @@ _pthread_mutexattr_settype(pthread_mutexattr_t *attr, int type)
{
int ret;
if (attr == NULL || *attr == NULL || type >= PTHREAD_MUTEX_TYPE_MAX) {
- errno = EINVAL;
- ret = -1;
+ ret = EINVAL;
} else {
(*attr)->m_type = type;
ret = 0;
@@ -167,7 +166,6 @@ _pthread_mutexattr_destroy(pthread_mutexattr_t *attr)
*attr = NULL;
ret = 0;
}
- return(ret);
}
int
OpenPOWER on IntegriCloud