Skip to content

Commit f841b85

Browse files
authored
Merge pull request #122 from TheSayOL/fix_poll
fix a bug for sys_poll and sys_ppoll
2 parents 027391d + 5030322 commit f841b85

File tree

1 file changed

+3
-1
lines changed
  • api/ruxos_posix_api/src/imp/io_mpx

1 file changed

+3
-1
lines changed

api/ruxos_posix_api/src/imp/io_mpx/poll.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,21 @@ fn poll_all(fds: &mut [ctypes::pollfd]) -> LinuxResult<usize> {
2424
Err(_) => {
2525
if (events & ctypes::EPOLLERR as i16) != 0 {
2626
*revents |= ctypes::EPOLLERR as i16;
27+
events_num += 1;
2728
}
2829
}
2930
Ok(state) => {
3031
if state.readable && (events & ctypes::EPOLLIN as i16 != 0) {
3132
*revents |= ctypes::EPOLLIN as i16;
33+
events_num += 1;
3234
}
3335

3436
if state.writable && (events & ctypes::EPOLLOUT as i16 != 0) {
3537
*revents |= ctypes::EPOLLOUT as i16;
38+
events_num += 1;
3639
}
3740
}
3841
}
39-
events_num += 1;
4042
}
4143
Ok(events_num)
4244
}

0 commit comments

Comments
 (0)