mirror of
https://github.com/apache/nuttx.git
synced 2026-08-03 05:09:00 +00:00
vfs/poll: add proper handling for sem_timedwait errnos. From Jussi Kivilinna
This commit is contained in:
parent
21b1297162
commit
6eee578317
1 changed files with 16 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue