mq_timedreceive() move the location where the errno value is set; the TIMEDOUT errno setting was being overwritten by subsequent actions before returning. Noted by Freddie Chopin.

This commit is contained in:
Gregory Nutt 2015-06-03 07:24:50 -06:00
parent f0da343f24
commit 84f0303fc0
3 changed files with 5 additions and 3 deletions

View File

@ -258,11 +258,13 @@ ssize_t mq_timedreceive(mqd_t mqdes, FAR char *msg, size_t msglen,
if (result != OK)
{
set_errno(result);
irqrestore(saved_state);
sched_unlock();
wd_delete(rtcb->waitdog);
rtcb->waitdog = NULL;
set_errno(result);
return ERROR;
}

View File

@ -351,7 +351,8 @@ errout_with_irqsave:
errout_with_mqmsg:
mq_msgfree(mqmsg);
set_errno(result);
sched_unlock();
set_errno(result);
return ERROR;
}

View File

@ -143,4 +143,3 @@ void mq_waitirq(FAR struct tcb_s *wtcb, int errcode)
irqrestore(saved_state);
}