Skip to content

Commit

Permalink
Fix build on 32 bit arm where tv_sec (time_t) is i32
Browse files Browse the repository at this point in the history
  • Loading branch information
seanyoung authored and coolreader18 committed Aug 23, 2022
1 parent 561950c commit 909b3d2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ fn systime_to_timeval(time: &SystemTime) -> libc::timeval {
}

fn timeval_to_systime(tv: &libc::timeval) -> SystemTime {
let dur = Duration::new(tv.tv_sec.unsigned_abs(), tv.tv_usec as u32 * 1000);
let dur = Duration::new(tv.tv_sec as u64, tv.tv_usec as u32 * 1000);
if tv.tv_sec >= 0 {
SystemTime::UNIX_EPOCH + dur
} else {
Expand Down

0 comments on commit 909b3d2

Please sign in to comment.