* NEWS: Mention this.
* localtime.c (tzfile_changed): Assign from st_ctim
via individual members, to work around AIX 7.3’s
default failure to conform to POSIX.1-2008.
This glitch was introduced in 2025c.
---
 NEWS        | 3 +++
 localtime.c | 5 +++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/NEWS b/NEWS
index 4f95684e..ef9689f3 100644
--- a/NEWS
+++ b/NEWS
@@ -65,6 +65,9 @@ Unreleased, experimental changes
     functions have not used since 2026c’s removal of the old
     posixrules feature.
 
+    localtime.c now works on AIX 7.3 by default again, working
+    around AIX’s POSIX-conformance glitch with st_ctim.
+
   Changes to documentation
 
     URLs for release tarballs in tz-link.html have been updated to
diff --git a/localtime.c b/localtime.c
index 3ffb02d1..276f8890 100644
--- a/localtime.c
+++ b/localtime.c
@@ -832,10 +832,11 @@ tzfile_changed(int fd, struct stat *st)
        resolution if available, as this can help distinguish files on
        non-POSIX platforms where st_dev and st_ino are unreliable.  */
     struct timespec ctim;
+    /* Copy via members, as AIX 7.3 defaults to an incompatible st_ctim.  */
+    ctim.tv_sec = st->st_ctime;
 #if HAVE_STRUCT_STAT_ST_CTIM
-    ctim = st->st_ctim;
+    ctim.tv_nsec = st->st_ctim.tv_nsec;
 #else
-    ctim.tv_sec = st->st_ctime;
     ctim.tv_nsec = 0;
 #endif
 
-- 
2.55.0

Reply via email to