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.
This commit is contained in:
mtm 2004-03-29 13:57:55 +00:00
parent 1e599449cf
commit 4f6d01c449

View File

@ -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;