poll: defalut set POLLERR POLLHUP to events

Signed-off-by: ligd <liguiding1@xiaomi.com>
This commit is contained in:
ligd 2022-07-07 17:54:18 +08:00 committed by Xiang Xiao
parent 434c49f282
commit 5f68aa56fd

View File

@ -120,6 +120,7 @@ static inline int poll_setup(FAR struct pollfd *fds, nfds_t nfds,
fds[i].sem = sem;
fds[i].revents = 0;
fds[i].priv = NULL;
fds[i].events |= POLLERR | POLLHUP;
/* Check for invalid descriptors. "If the value of fd is less than 0,
* events shall be ignored, and revents shall be set to 0 in that entry