Another oops. I introduced a but in a previous commit. The CAN read method nees to return an error if sem_wait() fails for any reason

This commit is contained in:
Gregory Nutt 2015-07-15 18:51:31 -06:00
parent 621fef2c31
commit 048d338808

View File

@ -330,9 +330,8 @@ static ssize_t can_read(FAR struct file *filep, FAR char *buffer,
do
{
ret = sem_wait(&dev->cd_recv.rx_sem);
DEBUGASSERT(ret >= 0 || errno == EINTR);
}
while (dev->cd_recv.rx_head == dev->cd_recv.rx_tail);
while (ret >= 0 && dev->cd_recv.rx_head == dev->cd_recv.rx_tail);
dev->cd_nrxwaiters--;
if (ret < 0)