use subdsec_micros() instead of subsec_nanos() / 1000

This commit is contained in:
Matthias Krüger 2020-03-01 20:09:14 +01:00
parent eda8d82b95
commit 03aecda83a

View File

@ -280,7 +280,7 @@ impl Socket {
};
let mut timeout = libc::timeval {
tv_sec: secs,
tv_usec: (dur.subsec_nanos() / 1000) as libc::suseconds_t,
tv_usec: dur.subsec_micros() as libc::suseconds_t,
};
if timeout.tv_sec == 0 && timeout.tv_usec == 0 {
timeout.tv_usec = 1;