From 74189d84e236d3852790bea9f2c524ef70d6a0cc Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 2 Feb 2017 06:42:41 -0600 Subject: [PATCH] Cancellation points: Fix some backward logic in conditional compilation. --- sched/mqueue/mq_rcvinternal.c | 2 +- sched/mqueue/mq_sndinternal.c | 2 +- sched/semaphore/sem_wait.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sched/mqueue/mq_rcvinternal.c b/sched/mqueue/mq_rcvinternal.c index 91701e5e07..459004c4ac 100644 --- a/sched/mqueue/mq_rcvinternal.c +++ b/sched/mqueue/mq_rcvinternal.c @@ -148,7 +148,7 @@ FAR struct mqueue_msg_s *mq_waitreceive(mqd_t mqdes) if (enter_cancellation_point()) { -#ifndef CONFIG_CANCELLATION_POINTS /* Not reachable in this case */ +#ifdef CONFIG_CANCELLATION_POINTS /* If there is a pending cancellation, then do not perform * the wait. Exit now with ECANCELED. */ diff --git a/sched/mqueue/mq_sndinternal.c b/sched/mqueue/mq_sndinternal.c index c59250683f..946c69275c 100644 --- a/sched/mqueue/mq_sndinternal.c +++ b/sched/mqueue/mq_sndinternal.c @@ -239,7 +239,7 @@ int mq_waitsend(mqd_t mqdes) if (enter_cancellation_point()) { -#ifndef CONFIG_CANCELLATION_POINTS /* Not reachable in this case */ +#ifdef CONFIG_CANCELLATION_POINTS /* If there is a pending cancellation, then do not perform * the wait. Exit now with ECANCELED. */ diff --git a/sched/semaphore/sem_wait.c b/sched/semaphore/sem_wait.c index 1aec3679d8..c51cdcb1f0 100644 --- a/sched/semaphore/sem_wait.c +++ b/sched/semaphore/sem_wait.c @@ -98,7 +98,7 @@ int sem_wait(FAR sem_t *sem) if (enter_cancellation_point()) { -#ifndef CONFIG_CANCELLATION_POINTS /* Not reachable in this case */ +#ifdef CONFIG_CANCELLATION_POINTS /* If there is a pending cancellation, then do not perform * the wait. Exit now with ECANCELED. */