diff --git a/ulib/libax/src/cbindings/io_mpx/epoll.rs b/ulib/libax/src/cbindings/io_mpx/epoll.rs index 0131ea1284..2f99fbca93 100644 --- a/ulib/libax/src/cbindings/io_mpx/epoll.rs +++ b/ulib/libax/src/cbindings/io_mpx/epoll.rs @@ -37,7 +37,7 @@ impl EpollInstance { } pub fn control(&self, op: usize, fd: usize, event: &ctypes::epoll_event) -> LinuxResult { - match get_file_like(fd) { + match get_file_like(fd as c_int) { Ok(_) => {} Err(e) => return Err(e), } @@ -47,13 +47,13 @@ impl EpollInstance { if let Entry::Occupied(_) = self.events.lock().entry(fd) { return Err(LinuxError::EEXIST); } - self.events.lock().insert(fd, event.clone()); + self.events.lock().insert(fd, *event); self.new_ctl_list.lock().insert(fd); } ctypes::EPOLL_CTL_MOD => { let mut events = self.events.lock(); if let Entry::Occupied(mut ocp) = events.entry(fd) { - ocp.insert(event.clone()); + ocp.insert(*event); self.new_ctl_list.lock().insert(fd); } else { return Err(LinuxError::ENOENT); @@ -213,13 +213,13 @@ pub unsafe extern "C" fn ax_epoll_wait( let epollevent = epoll_instance.events.lock().get_mut(infd).cloned().unwrap(); if status.readable && ((epollevent.events & ctypes::EPOLLIN) != 0) { (*events.add(events_num)).events = ctypes::EPOLLIN; - (*events.add(events_num)).data.u64_ = epollevent.data.ptr; + (*events.add(events_num)).data.u64_ = epollevent.data.u64_; events_num += 1; } if status.writable && ((epollevent.events & ctypes::EPOLLOUT) != 0) { (*events.add(events_num)).events = ctypes::EPOLLOUT; - (*events.add(events_num)).data.u64_ = epollevent.data.ptr; + (*events.add(events_num)).data.u64_ = epollevent.data.u64_; events_num += 1; } }