diff options
Diffstat (limited to 'nuttx/sched/sem_init.c')
-rw-r--r-- | nuttx/sched/sem_init.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/nuttx/sched/sem_init.c b/nuttx/sched/sem_init.c index 36f2b9942..861d62056 100644 --- a/nuttx/sched/sem_init.c +++ b/nuttx/sched/sem_init.c @@ -38,6 +38,7 @@ ************************************************************/ #include <sys/types.h> +#include <limits.h> #include <semaphore.h> #include "sem_internal.h" @@ -100,7 +101,7 @@ int sem_init (sem_t *sem, int pshared, unsigned int value) { int ret = ERROR; - if (sem && value <= SEM_MAX_VALUE) + if (sem && value <= SEM_VALUE_MAX) { sem->semcount = (sint16)value; ret = OK; |