Skip to content

Commit

Permalink
Support dates prior to Unix Epoch on Linux
Browse files Browse the repository at this point in the history
This changes the `st_(a|m|c)time` fields on Linux to
`i64` from `u64` to support times before Unix Epoch.

Before this change, downstream crates would see `i64`
times that have been cast to `u64`, which is unexpected
as it then represents a time unimaginably far in the future.
  • Loading branch information
Byron committed Jan 15, 2024
1 parent aecc981 commit e26fd5a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/backend/libc/fs/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -986,11 +986,11 @@ pub struct Stat {
pub st_size: i64,
pub st_blksize: u32,
pub st_blocks: u64,
pub st_atime: u64,
pub st_atime: i64,
pub st_atime_nsec: u32,
pub st_mtime: u64,
pub st_mtime: i64,
pub st_mtime_nsec: u32,
pub st_ctime: u64,
pub st_ctime: i64,
pub st_ctime_nsec: u32,
pub st_ino: u64,
}
Expand Down
6 changes: 3 additions & 3 deletions src/backend/linux_raw/fs/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -653,11 +653,11 @@ pub struct Stat {
pub st_size: i64,
pub st_blksize: u32,
pub st_blocks: u64,
pub st_atime: u64,
pub st_atime: i64,
pub st_atime_nsec: u32,
pub st_mtime: u64,
pub st_mtime: i64,
pub st_mtime_nsec: u32,
pub st_ctime: u64,
pub st_ctime: i64,
pub st_ctime_nsec: u32,
pub st_ino: u64,
}
Expand Down

0 comments on commit e26fd5a

Please sign in to comment.