summaryrefslogtreecommitdiff
path: root/nuttx/sched/sig_timedwait.c
diff options
context:
space:
mode:
Diffstat (limited to 'nuttx/sched/sig_timedwait.c')
-rw-r--r--nuttx/sched/sig_timedwait.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/nuttx/sched/sig_timedwait.c b/nuttx/sched/sig_timedwait.c
index dbbf444dc..2d9afaab1 100644
--- a/nuttx/sched/sig_timedwait.c
+++ b/nuttx/sched/sig_timedwait.c
@@ -277,12 +277,18 @@ int sigtimedwait(FAR const sigset_t *set, FAR struct siginfo *info,
if (info)
{
memcpy(info, &rtcb->sigunbinfo, sizeof(struct siginfo));
- }
- irqrestore(saved_state);
- /* The return value is the number of the signal that awakened us */
+ /* The return value is the number of the signal that awakened us */
- ret = info->si_signo;
+ ret = info->si_signo;
+ }
+ else
+ {
+ /* We don't know which signal awakened us. This is probably a bug. */
+
+ ret = 0;
+ }
+ irqrestore(saved_state);
}
sched_unlock();