You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2021/09/15 04:02:59 UTC
[incubator-nuttx] branch master updated: vfs/poll: correct the
return event if inode has closed
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new 6dde42d vfs/poll: correct the return event if inode has closed
6dde42d is described below
commit 6dde42d79b906c3e7b1d4a439b6030fb45d8bd6b
Author: chao.an <an...@xiaomi.com>
AuthorDate: Thu Sep 9 11:38:03 2021 +0800
vfs/poll: correct the return event if inode has closed
Signed-off-by: chao.an <an...@xiaomi.com>
---
fs/vfs/fs_poll.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/fs/vfs/fs_poll.c b/fs/vfs/fs_poll.c
index 31967b9..11a4a4b 100644
--- a/fs/vfs/fs_poll.c
+++ b/fs/vfs/fs_poll.c
@@ -299,7 +299,7 @@ int file_poll(FAR struct file *filep, FAR struct pollfd *fds, bool setup)
FAR struct inode *inode;
int ret = -ENOSYS;
- DEBUGASSERT(filep != NULL && filep->f_inode != NULL);
+ DEBUGASSERT(filep != NULL);
inode = filep->f_inode;
if (inode != NULL)
@@ -337,6 +337,13 @@ int file_poll(FAR struct file *filep, FAR struct pollfd *fds, bool setup)
ret = OK;
}
}
+ else
+ {
+ fds->revents |= (POLLERR | POLLHUP);
+ nxsem_post(fds->sem);
+
+ ret = OK;
+ }
return ret;
}