From 1537061e4e8d2d77fd03e0efe6338c29756b4901 Mon Sep 17 00:00:00 2001 From: patacongo Date: Thu, 5 Jun 2008 01:57:49 +0000 Subject: Fix recursive mutex bug git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@770 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/sched/pthread_mutexattrsettype.c | 2 +- nuttx/sched/pthread_mutexattrverifytype.c | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'nuttx') 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 */ -- cgit v1.2.3