|
@@ -47,7 +47,8 @@ pub fn wait(fd: RawFd, duration: Option<Duration>) -> io::Result<()> {
|
|
|
let mut timeout = libc::timeval { tv_sec: 0, tv_usec: 0 };
|
|
|
let timeout_ptr =
|
|
|
if let Some(duration) = duration {
|
|
|
- timeout.tv_usec = (duration.total_millis() * 1_000) as libc::suseconds_t;
|
|
|
+ timeout.tv_sec = duration.secs() as libc::time_t;
|
|
|
+ timeout.tv_usec = (duration.millis() * 1_000) as libc::suseconds_t;
|
|
|
&mut timeout as *mut _
|
|
|
} else {
|
|
|
ptr::null_mut()
|