Skip to content

Commit

Permalink
Merge pull request #909 from wesleywiser/update_timespec_use
Browse files Browse the repository at this point in the history
Update use of `libc::timespec` to prepare for future libc version
  • Loading branch information
GuillaumeGomez committed Jan 10, 2023
2 parents 2275e72 + 5b699bb commit 3d87322
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/linux/system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,8 @@ fn boot_time() -> u64 {
}
}
// Either we didn't find "btime" or "/proc/stat" wasn't available for some reason...
let mut up = libc::timespec {
tv_sec: 0,
tv_nsec: 0,
};
unsafe {
let mut up: libc::timespec = std::mem::zeroed();
if libc::clock_gettime(libc::CLOCK_BOOTTIME, &mut up) == 0 {
up.tv_sec as u64
} else {
Expand Down

0 comments on commit 3d87322

Please sign in to comment.