[poll] Fix panic for non-opened fds
This commit is contained in:
parent
57ab3f9d9f
commit
0ddb8be317
@ -35,6 +35,7 @@ pub fn do_poll_new(poll_fds: &[PollFd], mut timeout: Option<&mut Duration>) -> R
|
|||||||
if file.is_none() {
|
if file.is_none() {
|
||||||
poll_fd.revents.set(IoEvents::NVAL);
|
poll_fd.revents.set(IoEvents::NVAL);
|
||||||
invalid_fd_count += 1;
|
invalid_fd_count += 1;
|
||||||
|
return None;
|
||||||
}
|
}
|
||||||
|
|
||||||
Some((file.unwrap(), poll_fd.events))
|
Some((file.unwrap(), poll_fd.events))
|
||||||
|
Loading…
Reference in New Issue
Block a user