Skip to content

Commit

Permalink
📝 fix kqueue duration conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
Xudong-Huang committed Oct 26, 2024
1 parent 19c6fbb commit 27c7f86
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/io/sys/unix/kqueue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use super::{timeout_handler, TimerList};
use super::{EventData, IoData};
use crate::scheduler::Scheduler;
#[cfg(feature = "io_timeout")]
use crate::timeout_list::{now, ns_to_dur};
use crate::timeout_list::now;

use may_queue::mpsc::Queue;
use smallvec::SmallVec;
Expand Down Expand Up @@ -106,7 +106,7 @@ impl Selector {
) -> io::Result<Option<u64>> {
#[cfg(feature = "io_timeout")]
let timeout_spec = _timeout.map(|to| {
let dur = ns_to_dur(to);
let dur = Duration::from_nanos(to);
libc::timespec {
tv_sec: dur.as_secs() as libc::time_t,
tv_nsec: dur.subsec_nanos() as libc::c_long,
Expand Down

0 comments on commit 27c7f86

Please sign in to comment.