Skip to content

Commit

Permalink
.bzip2.rs: fix cast to time_t
Browse files Browse the repository at this point in the history
  • Loading branch information
Folkert de Vries committed Nov 13, 2024
1 parent 97cce6b commit 4486576
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions bzip2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -969,8 +969,9 @@ unsafe fn count_hardlinks(path: &Path) -> u64 {
fn apply_saved_time_info_to_output_file(_dst_name: &CStr, _metadata: Metadata) {
#[cfg(unix)]
{
let convert =
|x: SystemTime| x.duration_since(SystemTime::UNIX_EPOCH).unwrap().as_secs() as i64;
let convert = |x: SystemTime| {
x.duration_since(SystemTime::UNIX_EPOCH).unwrap().as_secs() as libc::time_t
};

let actime = convert(_metadata.accessed().unwrap_or(SystemTime::UNIX_EPOCH));
let modtime = convert(_metadata.modified().unwrap_or(SystemTime::UNIX_EPOCH));
Expand Down

0 comments on commit 4486576

Please sign in to comment.