Skip to content

Commit 51b5eac

Browse files
author
Mathias Svensson
committed
Fix the inner type of EpollFlags
1 parent 7435cb6 commit 51b5eac

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

src/sys/epoll.rs

+17-17
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,22 @@ use ::Error;
77

88
bitflags!(
99
#[repr(C)]
10-
pub flags EpollFlags: u32 {
11-
const EPOLLIN = libc::EPOLLIN as u32,
12-
const EPOLLPRI = libc::EPOLLPRI as u32,
13-
const EPOLLOUT = libc::EPOLLOUT as u32,
14-
const EPOLLRDNORM = libc::EPOLLRDNORM as u32,
15-
const EPOLLRDBAND = libc::EPOLLRDBAND as u32,
16-
const EPOLLWRNORM = libc::EPOLLWRNORM as u32,
17-
const EPOLLWRBAND = libc::EPOLLWRBAND as u32,
18-
const EPOLLMSG = libc::EPOLLMSG as u32,
19-
const EPOLLERR = libc::EPOLLERR as u32,
20-
const EPOLLHUP = libc::EPOLLHUP as u32,
21-
const EPOLLRDHUP = libc::EPOLLRDHUP as u32,
10+
pub flags EpollFlags: libc::c_int {
11+
const EPOLLIN = libc::EPOLLIN,
12+
const EPOLLPRI = libc::EPOLLPRI,
13+
const EPOLLOUT = libc::EPOLLOUT,
14+
const EPOLLRDNORM = libc::EPOLLRDNORM,
15+
const EPOLLRDBAND = libc::EPOLLRDBAND,
16+
const EPOLLWRNORM = libc::EPOLLWRNORM,
17+
const EPOLLWRBAND = libc::EPOLLWRBAND,
18+
const EPOLLMSG = libc::EPOLLMSG,
19+
const EPOLLERR = libc::EPOLLERR,
20+
const EPOLLHUP = libc::EPOLLHUP,
21+
const EPOLLRDHUP = libc::EPOLLRDHUP,
2222
const EPOLLEXCLUSIVE = 1 << 28,
23-
const EPOLLWAKEUP = libc::EPOLLWAKEUP as u32,
24-
const EPOLLONESHOT = libc::EPOLLONESHOT as u32,
25-
const EPOLLET = libc::EPOLLET as u32,
23+
const EPOLLWAKEUP = libc::EPOLLWAKEUP,
24+
const EPOLLONESHOT = libc::EPOLLONESHOT,
25+
const EPOLLET = libc::EPOLLET,
2626
}
2727
);
2828

@@ -48,15 +48,15 @@ pub struct EpollEvent {
4848

4949
impl EpollEvent {
5050
pub fn new(events: EpollFlags, data: u64) -> Self {
51-
EpollEvent { event: libc::epoll_event { events: events.bits(), u64: data } }
51+
EpollEvent { event: libc::epoll_event { events: events.bits() as u32, u64: data } }
5252
}
5353

5454
pub fn empty() -> Self {
5555
unsafe { mem::zeroed::<EpollEvent>() }
5656
}
5757

5858
pub fn events(&self) -> EpollFlags {
59-
EpollFlags::from_bits(self.event.events).unwrap()
59+
EpollFlags::from_bits(self.event.events as libc::c_int).unwrap()
6060
}
6161

6262
pub fn data(&self) -> u64 {

0 commit comments

Comments
 (0)