diff --git a/fs/vfs/fs_poll.c b/fs/vfs/fs_poll.c index 31967b90d0c..11a4a4b44d9 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; }