diff options
Diffstat (limited to 'nuttx/sched/sem_wait.c')
-rw-r--r-- | nuttx/sched/sem_wait.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/nuttx/sched/sem_wait.c b/nuttx/sched/sem_wait.c index cbf8fd019..b31a48fa8 100644 --- a/nuttx/sched/sem_wait.c +++ b/nuttx/sched/sem_wait.c @@ -156,11 +156,13 @@ int sem_wait(sem_t *sem) /* Add the TCB to the prioritized semaphore wait queue */ + *get_errno_ptr() = 0; up_block_task(rtcb, TSTATE_WAIT_SEM); /* When we resume at this point, either (1) the semaphore has been * assigned to this thread of execution, or (2) the semaphore wait - * has been interrupted by a signal. + * has been interrupted by a signal. We can detect the latter case + * be examining the errno value. */ if (*get_errno_ptr() != EINTR) |