diff --git a/sched/mqueue/mq_rcvinternal.c b/sched/mqueue/mq_rcvinternal.c index 1b9c249e75a..8bd9545c868 100644 --- a/sched/mqueue/mq_rcvinternal.c +++ b/sched/mqueue/mq_rcvinternal.c @@ -148,6 +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 *. /* If there is a pending cancellation, then do not perform * the wait. Exit now with ECANCELED. */ @@ -155,6 +156,7 @@ FAR struct mqueue_msg_s *mq_waitreceive(mqd_t mqdes) set_errno(ECANCELED); leave_cancellation_point(); return NULL; +#endif } /* Get a pointer to the message queue */ diff --git a/sched/mqueue/mq_sndinternal.c b/sched/mqueue/mq_sndinternal.c index 10721add0a0..a8b74ade72e 100644 --- a/sched/mqueue/mq_sndinternal.c +++ b/sched/mqueue/mq_sndinternal.c @@ -239,6 +239,7 @@ int mq_waitsend(mqd_t mqdes) if (enter_cancellation_point()) { +#ifndef CONFIG_CANCELLATION_POINTS /* Not reachable in this case *. /* If there is a pending cancellation, then do not perform * the wait. Exit now with ECANCELED. */ @@ -246,6 +247,7 @@ int mq_waitsend(mqd_t mqdes) set_errno(ECANCELED); leave_cancellation_point(); return ERROR; +#endif } /* Get a pointer to the message queue */ diff --git a/sched/semaphore/sem_wait.c b/sched/semaphore/sem_wait.c index 80827b62db5..4a01ffcafaf 100644 --- a/sched/semaphore/sem_wait.c +++ b/sched/semaphore/sem_wait.c @@ -98,6 +98,7 @@ int sem_wait(FAR sem_t *sem) if (enter_cancellation_point()) { +#ifndef CONFIG_CANCELLATION_POINTS /* Not reachable in this case *. /* If there is a pending cancellation, then do not perform * the wait. Exit now with ECANCELED. */ @@ -106,6 +107,7 @@ int sem_wait(FAR sem_t *sem) leave_cancellation_point(); leave_critical_section(flags); return ERROR; +#endif } /* Make sure we were supplied with a valid semaphore. */