vfs/fs_poll: not clear POLLIN event if POLLHUP or POLLERR set

Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
This commit is contained in:
wangbowen6 2022-09-26 17:14:52 +08:00 committed by Masayuki Ishikawa
parent 2e1c522a79
commit 5e46a9908a

View File

@ -312,9 +312,9 @@ void poll_notify(FAR struct pollfd **afds, int nfds, pollevent_t eventset)
fds->revents |= eventset & (fds->events | POLLERR | POLLHUP); fds->revents |= eventset & (fds->events | POLLERR | POLLHUP);
if ((fds->revents & (POLLERR | POLLHUP)) != 0) if ((fds->revents & (POLLERR | POLLHUP)) != 0)
{ {
/* Error, clear POLLIN and POLLOUT event */ /* Error or Hung up, clear POLLOUT event */
fds->revents &= ~(POLLIN | POLLOUT); fds->revents &= ~POLLOUT;
} }
if (fds->revents != 0) if (fds->revents != 0)