Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 40 additions & 8 deletions gix-index/src/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,30 @@ impl Metadata {
pub fn modified(&self) -> Option<SystemTime> {
#[cfg(not(windows))]
{
#[cfg(not(any(target_os = "aix", target_os = "hurd")))]
#[cfg(not(any(
target_os = "aix",
target_os = "hurd",
all(target_arch = "loongarch64", target_env = "musl")
)))]
let seconds = self.0.st_mtime;
#[cfg(any(target_os = "aix", target_os = "hurd"))]
#[cfg(any(
target_os = "aix",
target_os = "hurd",
all(target_arch = "loongarch64", target_env = "musl")
))]
let seconds = self.0.st_mtim.tv_sec;

#[cfg(not(any(target_os = "aix", target_os = "hurd")))]
#[cfg(not(any(
target_os = "aix",
target_os = "hurd",
all(target_arch = "loongarch64", target_env = "musl")
)))]
let nanoseconds = self.0.st_mtime_nsec;
#[cfg(any(target_os = "aix", target_os = "hurd"))]
#[cfg(any(
target_os = "aix",
target_os = "hurd",
all(target_arch = "loongarch64", target_env = "musl")
))]
let nanoseconds = self.0.st_mtim.tv_nsec;

// All operating systems treat the seconds as offset from unix epoch, hence it must
Expand All @@ -81,14 +97,30 @@ impl Metadata {
pub fn created(&self) -> Option<SystemTime> {
#[cfg(not(windows))]
{
#[cfg(not(any(target_os = "aix", target_os = "hurd")))]
#[cfg(not(any(
target_os = "aix",
target_os = "hurd",
all(target_arch = "loongarch64", target_env = "musl")
)))]
let seconds = self.0.st_ctime;
#[cfg(any(target_os = "aix", target_os = "hurd"))]
#[cfg(any(
target_os = "aix",
target_os = "hurd",
all(target_arch = "loongarch64", target_env = "musl")
))]
let seconds = self.0.st_ctim.tv_sec;

#[cfg(not(any(target_os = "aix", target_os = "hurd")))]
#[cfg(not(any(
target_os = "aix",
target_os = "hurd",
all(target_arch = "loongarch64", target_env = "musl")
)))]
let nanoseconds = self.0.st_ctime_nsec;
#[cfg(any(target_os = "aix", target_os = "hurd"))]
#[cfg(any(
target_os = "aix",
target_os = "hurd",
all(target_arch = "loongarch64", target_env = "musl")
))]
let nanoseconds = self.0.st_ctim.tv_nsec;

// All operating systems treat the seconds as offset from unix epoch, hence it must
Expand Down
Loading