Skip to content

Commit 01c7317

Browse files
authored
bugfix: pollfd copied unintentionally
1 parent afcbd90 commit 01c7317

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

examples/manpage.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ fn fault_handler_thread(uffd: Uffd) {
2929
loop {
3030
// See what poll() tells us about the userfaultfd
3131

32-
let pollfd = PollFd::new(&uffd, PollFlags::POLLIN);
33-
let nready = poll(&mut [pollfd], -1).expect("poll");
32+
let mut fds = [PollFd::new(&uffd, PollFlags::POLLIN)];
33+
let nready = poll(&mut fds, -1).expect("poll");
34+
let pollfd = fds[0];
3435

3536
println!("\nfault_handler_thread():");
3637
let revents = pollfd.revents().unwrap();

0 commit comments

Comments
 (0)