Make pthread_mutexattr_settype to return error number directly and
conformant to POSIX specification. Bug reported by: modelnine at modelnine dt org
This commit is contained in:
parent
56b72c6a35
commit
1bc96ca9dc
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user