From fa7c2eee1476fd5c3578b035ebb8ae8ef11255f6 Mon Sep 17 00:00:00 2001 From: guenther Date: Sun, 6 Aug 2023 19:36:13 +0000 Subject: [PATCH] Prefer the POSIX standard st_*tim struct timespec members over the older BSD st_*timespec names. ok millert@ --- usr.bin/stat/stat.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/usr.bin/stat/stat.c b/usr.bin/stat/stat.c index d5dc5787c98..1dc742be8db 100644 --- a/usr.bin/stat/stat.c +++ b/usr.bin/stat/stat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: stat.c,v 1.24 2023/08/06 19:33:54 guenther Exp $ */ +/* $OpenBSD: stat.c,v 1.25 2023/08/06 19:36:13 guenther Exp $ */ /* $NetBSD: stat.c,v 1.19 2004/06/20 22:20:16 jmc Exp $ */ /* @@ -611,27 +611,27 @@ format1(const struct stat *st, case SHOW_st_atime: gottime = 1; secs = st->st_atime; - nsecs = st->st_atimensec; + nsecs = st->st_atim.tv_nsec; /* FALLTHROUGH */ case SHOW_st_mtime: if (!gottime) { gottime = 1; secs = st->st_mtime; - nsecs = st->st_mtimensec; + nsecs = st->st_mtim.tv_nsec; } /* FALLTHROUGH */ case SHOW_st_ctime: if (!gottime) { gottime = 1; secs = st->st_ctime; - nsecs = st->st_ctimensec; + nsecs = st->st_ctim.tv_nsec; } /* FALLTHROUGH */ case SHOW_st_btime: if (!gottime) { gottime = 1; - secs = st->__st_birthtimespec.tv_sec; - nsecs = st->__st_birthtimespec.tv_nsec; + secs = st->__st_birthtime; + nsecs = st->__st_birthtim.tv_nsec; } small = (sizeof(secs) == 4); data = secs; -- 2.20.1