From 5f68aa56fd092b517271ebb394837076b16af135 Mon Sep 17 00:00:00 2001 From: ligd Date: Thu, 7 Jul 2022 17:54:18 +0800 Subject: [PATCH] poll: defalut set POLLERR POLLHUP to events Signed-off-by: ligd --- fs/vfs/fs_poll.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/vfs/fs_poll.c b/fs/vfs/fs_poll.c index 429addd64e..9c784baf81 100644 --- a/fs/vfs/fs_poll.c +++ b/fs/vfs/fs_poll.c @@ -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