diff options
author | Mathias Svensson <idolf@pwnies.dk> | 2017-02-22 22:37:55 +0100 |
---|---|---|
committer | Mathias Svensson <idolf@pwnies.dk> | 2017-02-22 22:48:14 +0100 |
commit | 51b5eac2cecd87826f2b675e011b5f314d0aa9eb (patch) | |
tree | 12f2f7ab7008d4ad37a3a30a277c54b7ab661c0c | |
parent | 7435cb645bca3c5f89adca33a9411e6abd9c67aa (diff) | |
download | nix-51b5eac2cecd87826f2b675e011b5f314d0aa9eb.zip |
Fix the inner type of EpollFlags
-rw-r--r-- | src/sys/epoll.rs | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/sys/epoll.rs b/src/sys/epoll.rs index 7be20f86..54e2eead 100644 --- a/src/sys/epoll.rs +++ b/src/sys/epoll.rs @@ -7,22 +7,22 @@ use ::Error; bitflags!( #[repr(C)] - pub flags EpollFlags: u32 { - const EPOLLIN = libc::EPOLLIN as u32, - const EPOLLPRI = libc::EPOLLPRI as u32, - const EPOLLOUT = libc::EPOLLOUT as u32, - const EPOLLRDNORM = libc::EPOLLRDNORM as u32, - const EPOLLRDBAND = libc::EPOLLRDBAND as u32, - const EPOLLWRNORM = libc::EPOLLWRNORM as u32, - const EPOLLWRBAND = libc::EPOLLWRBAND as u32, - const EPOLLMSG = libc::EPOLLMSG as u32, - const EPOLLERR = libc::EPOLLERR as u32, - const EPOLLHUP = libc::EPOLLHUP as u32, - const EPOLLRDHUP = libc::EPOLLRDHUP as u32, + pub flags EpollFlags: libc::c_int { + const EPOLLIN = libc::EPOLLIN, + const EPOLLPRI = libc::EPOLLPRI, + const EPOLLOUT = libc::EPOLLOUT, + const EPOLLRDNORM = libc::EPOLLRDNORM, + const EPOLLRDBAND = libc::EPOLLRDBAND, + const EPOLLWRNORM = libc::EPOLLWRNORM, + const EPOLLWRBAND = libc::EPOLLWRBAND, + const EPOLLMSG = libc::EPOLLMSG, + const EPOLLERR = libc::EPOLLERR, + const EPOLLHUP = libc::EPOLLHUP, + const EPOLLRDHUP = libc::EPOLLRDHUP, const EPOLLEXCLUSIVE = 1 << 28, - const EPOLLWAKEUP = libc::EPOLLWAKEUP as u32, - const EPOLLONESHOT = libc::EPOLLONESHOT as u32, - const EPOLLET = libc::EPOLLET as u32, + const EPOLLWAKEUP = libc::EPOLLWAKEUP, + const EPOLLONESHOT = libc::EPOLLONESHOT, + const EPOLLET = libc::EPOLLET, } ); @@ -48,7 +48,7 @@ pub struct EpollEvent { impl EpollEvent { pub fn new(events: EpollFlags, data: u64) -> Self { - EpollEvent { event: libc::epoll_event { events: events.bits(), u64: data } } + EpollEvent { event: libc::epoll_event { events: events.bits() as u32, u64: data } } } pub fn empty() -> Self { @@ -56,7 +56,7 @@ impl EpollEvent { } pub fn events(&self) -> EpollFlags { - EpollFlags::from_bits(self.event.events).unwrap() + EpollFlags::from_bits(self.event.events as libc::c_int).unwrap() } pub fn data(&self) -> u64 { |