diff --git a/nuttx/sched/pthread_mutexattrsettype.c b/nuttx/sched/pthread_mutexattrsettype.c index c50316c3c..150fc7c4f 100644 --- a/nuttx/sched/pthread_mutexattrsettype.c +++ b/nuttx/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/nuttx/sched/pthread_mutexattrverifytype.c b/nuttx/sched/pthread_mutexattrverifytype.c index e089be088..a172cb826 100644 --- a/nuttx/sched/pthread_mutexattrverifytype.c +++ b/nuttx/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 */