Skip to content

Commit 940e3ca

Browse files
authored
Merge pull request #1194 from ecnelises/aix_stattime
fix: use correct fields for ctime and mtime on AIX
2 parents 0fe20e8 + 569caa0 commit 940e3ca

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

gix-index/src/fs.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,16 @@ impl Metadata {
5555
#[cfg(not(windows))]
5656
{
5757
Some(system_time_from_secs_nanos(
58+
#[cfg(not(target_os = "aix"))]
5859
self.0.st_mtime.try_into().ok()?,
59-
#[cfg(not(target_os = "netbsd"))]
60+
#[cfg(target_os = "aix")]
61+
self.0.st_mtim.tv_sec.try_into().ok()?,
62+
#[cfg(not(any(target_os = "netbsd", target_os = "aix")))]
6063
self.0.st_mtime_nsec.try_into().ok()?,
6164
#[cfg(target_os = "netbsd")]
6265
self.0.st_mtimensec.try_into().ok()?,
66+
#[cfg(target_os = "aix")]
67+
self.0.st_mtim.tv_nsec.try_into().ok()?,
6368
))
6469
}
6570
#[cfg(windows)]
@@ -74,11 +79,16 @@ impl Metadata {
7479
#[cfg(not(windows))]
7580
{
7681
Some(system_time_from_secs_nanos(
82+
#[cfg(not(target_os = "aix"))]
7783
self.0.st_ctime.try_into().ok()?,
78-
#[cfg(not(target_os = "netbsd"))]
84+
#[cfg(target_os = "aix")]
85+
self.0.st_ctim.tv_sec.try_into().ok()?,
86+
#[cfg(not(any(target_os = "netbsd", target_os = "aix")))]
7987
self.0.st_ctime_nsec.try_into().ok()?,
8088
#[cfg(target_os = "netbsd")]
8189
self.0.st_ctimensec.try_into().ok()?,
90+
#[cfg(target_os = "aix")]
91+
self.0.st_ctim.tv_nsec.try_into().ok()?,
8292
))
8393
}
8494
#[cfg(windows)]

0 commit comments

Comments
 (0)