diff options
author | Philipp Matthias Schaefer <philipp.matthias.schaefer@posteo.de> | 2016-08-11 21:25:09 +0200 |
---|---|---|
committer | Philipp Matthias Schaefer <philipp.matthias.schaefer@posteo.de> | 2016-08-31 20:17:55 +0200 |
commit | 93dc2387bd336d843c3d39f0a44b906b637ec2f8 (patch) | |
tree | a0838f7c7cec6500a65c11eaffde71b83aa3668e /test/test_poll.rs | |
parent | 07039357d8d519ab1fe3591b9f9b05fd49ab4195 (diff) | |
download | nix-93dc2387bd336d843c3d39f0a44b906b637ec2f8.zip |
Use libc in poll.rs
Diffstat (limited to 'test/test_poll.rs')
-rw-r--r-- | test/test_poll.rs | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/test/test_poll.rs b/test/test_poll.rs index 54fd4029..13a95d2c 100644 --- a/test/test_poll.rs +++ b/test/test_poll.rs @@ -4,19 +4,15 @@ use nix::unistd::{write, pipe}; #[test] fn test_poll() { let (r, w) = pipe().unwrap(); - let mut fds = [PollFd { - fd: r, - events: POLLIN, - revents: EventFlags::empty() - }]; + let mut fds = [PollFd::new(r, POLLIN, EventFlags::empty())]; let nfds = poll(&mut fds, 100).unwrap(); assert_eq!(nfds, 0); - assert!(!fds[0].revents.contains(POLLIN)); + assert!(!fds[0].revents().unwrap().contains(POLLIN)); write(w, b".").unwrap(); let nfds = poll(&mut fds, 100).unwrap(); assert_eq!(nfds, 1); - assert!(fds[0].revents.contains(POLLIN)); + assert!(fds[0].revents().unwrap().contains(POLLIN)); } |