diff --git a/sched/pthread_mutexattrsettype.c b/sched/pthread_mutexattrsettype.c index c50316c3c7..150fc7c4ff 100644 --- a/sched/pthread_mutexattrsettype.c +++ b/sched/pthread_mutexattrsettype.c @@ -92,7 +92,7 @@ int pthread_mutexattr_settype(pthread_mutexattr_t *attr, int type) if (attr && pthread_mutexattr_verifytype(type) == OK) { attr->type = type; - return 0; + return OK; } return EINVAL; } diff --git a/sched/pthread_mutexattrverifytype.c b/sched/pthread_mutexattrverifytype.c index e089be0885..a172cb8260 100644 --- a/sched/pthread_mutexattrverifytype.c +++ b/sched/pthread_mutexattrverifytype.c @@ -89,7 +89,14 @@ int pthread_mutexattr_verifytype(int type) { /* The depends on the value assigments in pthread.h */ - return (type >= PTHREAD_MUTEX_NORMAL && type <= PTHREAD_MUTEX_RECURSIVE); + if (type >= PTHREAD_MUTEX_NORMAL && type <= PTHREAD_MUTEX_RECURSIVE) + { + return OK; + } + else + { + return ERROR; + } } #endif /* CONFIG_MUTEX_TYPES */