diff --git a/api/ruxos_posix_api/src/imp/io_mpx/poll.rs b/api/ruxos_posix_api/src/imp/io_mpx/poll.rs index 2daad9428..595639ef3 100644 --- a/api/ruxos_posix_api/src/imp/io_mpx/poll.rs +++ b/api/ruxos_posix_api/src/imp/io_mpx/poll.rs @@ -24,19 +24,21 @@ fn poll_all(fds: &mut [ctypes::pollfd]) -> LinuxResult { Err(_) => { if (events & ctypes::EPOLLERR as i16) != 0 { *revents |= ctypes::EPOLLERR as i16; + events_num += 1; } } Ok(state) => { if state.readable && (events & ctypes::EPOLLIN as i16 != 0) { *revents |= ctypes::EPOLLIN as i16; + events_num += 1; } if state.writable && (events & ctypes::EPOLLOUT as i16 != 0) { *revents |= ctypes::EPOLLOUT as i16; + events_num += 1; } } } - events_num += 1; } Ok(events_num) }