vfs/poll: add proper handling for sem_timedwait errnos. From Jussi Kivilinna

This commit is contained in:
Gregory Nutt 2014-11-21 06:38:26 -06:00
parent 21b1297162
commit 6eee578317

View File

@ -334,6 +334,22 @@ int poll(FAR struct pollfd *fds, nfds_t nfds, int timeout)
}
ret = sem_timedwait(&sem, &abstime);
if (ret < 0)
{
int err = get_errno();
if (err == ETIMEDOUT)
{
/* Return zero (OK) in the event of a timeout */
ret = OK;
}
else
{
ret = -err;
}
}
irqrestore(flags);
}
else