diff options
-rw-r--r-- | nuttx/fs/vfs/fs_poll.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/nuttx/fs/vfs/fs_poll.c b/nuttx/fs/vfs/fs_poll.c index 26f1ebd21..a7fd5ed62 100644 --- a/nuttx/fs/vfs/fs_poll.c +++ b/nuttx/fs/vfs/fs_poll.c @@ -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 |