include/nuttx/semaphore.h: Fix broken macros

This commit is contained in:
Gregory Nutt
2016-11-03 12:49:44 -06:00
parent 1da3a5fa61
commit 4c8ec0d2ca
6 changed files with 17 additions and 26 deletions
+1 -5
View File
@@ -35,11 +35,7 @@
# Add the semaphore C files to the build
CSRCS += sem_init.c sem_getvalue.c
ifeq ($(CONFIG_PRIORITY_INHERITANCE),y)
CSRCS += sem_getprotocol.c
endif
CSRCS += sem_init.c sem_getprotocol.c sem_getvalue.c
# Add the semaphore directory to the build
+9 -6
View File
@@ -43,8 +43,6 @@
#include <nuttx/semaphore.h>
#ifdef CONFIG_PRIORITY_INHERITANCE
/****************************************************************************
* Public Functions
****************************************************************************/
@@ -71,14 +69,19 @@ int sem_getprotocol(FAR sem_t *sem, FAR int *protocol)
{
DEBUGASSERT(sem != NULL && protocol != NULL);
#ifdef CONFIG_PRIORITY_INHERITANCE
if ((sem->flags & PRIOINHERIT_FLAGS_DISABLE) != 0)
{
return SEM_PRIO_NONE;
*protocol = SEM_PRIO_NONE;
}
else
{
return SEM_PRIO_INHERIT;
*protocol = SEM_PRIO_INHERIT;
}
}
#endif /* CONFIG_PRIORITY_INHERITANCE */
#else
*protocol = SEM_PRIO_NONE;
#endif
return OK;
}