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:
parent
1e599449cf
commit
4f6d01c449
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user