From 4f6d01c44926f7407c38b89af1e06f0bde17438d Mon Sep 17 00:00:00 2001 From: mtm Date: Mon, 29 Mar 2004 13:57:55 +0000 Subject: [PATCH] o Also check that the mutex type is not less than the minimum allowable value. o Don't check attribute for NULL. It's the callers responsibility. --- lib/libthr/thread/thr_mattr_kind_np.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/libthr/thread/thr_mattr_kind_np.c b/lib/libthr/thread/thr_mattr_kind_np.c index f3d30ff075b7..2b1e8afc8a10 100644 --- a/lib/libthr/thread/thr_mattr_kind_np.c +++ b/lib/libthr/thread/thr_mattr_kind_np.c @@ -71,9 +71,10 @@ int _pthread_mutexattr_settype(pthread_mutexattr_t *attr, int type) { int ret; - if (attr == NULL || *attr == NULL || type >= MUTEX_TYPE_MAX) { + if (*attr == NULL || type < PTHREAD_MUTEX_ERRORCHECK || + type >= MUTEX_TYPE_MAX) { errno = EINVAL; - ret = -1; + ret = EINVAL; } else { (*attr)->m_type = type; ret = 0;