From 481d9f43ae7c775106bfb762594729cd3ec7e955 Mon Sep 17 00:00:00 2001 From: Philip Guenther Date: Tue, 8 Aug 2023 04:45:45 +0000 Subject: Replace use of the old BSD st_*timensec members in struct stat with the POSIX-standard st_*tim.tv_nsec members. ok millert@ --- bin/ls/cmp.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'bin/ls/cmp.c') diff --git a/bin/ls/cmp.c b/bin/ls/cmp.c index fa4f11aeda6..d52062fe0fd 100644 --- a/bin/ls/cmp.c +++ b/bin/ls/cmp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmp.c,v 1.6 2009/10/27 23:59:21 deraadt Exp $ */ +/* $OpenBSD: cmp.c,v 1.7 2023/08/08 04:45:44 guenther Exp $ */ /* $NetBSD: cmp.c,v 1.10 1996/07/08 10:32:01 mycroft Exp $ */ /* @@ -61,9 +61,9 @@ modcmp(const FTSENT *a, const FTSENT *b) return (1); else if (b->fts_statp->st_mtime < a->fts_statp->st_mtime) return (-1); - else if (b->fts_statp->st_mtimensec > a->fts_statp->st_mtimensec) + else if (b->fts_statp->st_mtim.tv_nsec > a->fts_statp->st_mtim.tv_nsec) return (1); - else if (b->fts_statp->st_mtimensec < a->fts_statp->st_mtimensec) + else if (b->fts_statp->st_mtim.tv_nsec < a->fts_statp->st_mtim.tv_nsec) return (-1); else return (namecmp(a, b)); @@ -76,9 +76,9 @@ revmodcmp(const FTSENT *a, const FTSENT *b) return (-1); else if (b->fts_statp->st_mtime < a->fts_statp->st_mtime) return (1); - else if (b->fts_statp->st_mtimensec > a->fts_statp->st_mtimensec) + else if (b->fts_statp->st_mtim.tv_nsec > a->fts_statp->st_mtim.tv_nsec) return (-1); - else if (b->fts_statp->st_mtimensec < a->fts_statp->st_mtimensec) + else if (b->fts_statp->st_mtim.tv_nsec < a->fts_statp->st_mtim.tv_nsec) return (1); else return (revnamecmp(a, b)); @@ -91,9 +91,9 @@ acccmp(const FTSENT *a, const FTSENT *b) return (1); else if (b->fts_statp->st_atime < a->fts_statp->st_atime) return (-1); - else if (b->fts_statp->st_atimensec > a->fts_statp->st_atimensec) + else if (b->fts_statp->st_atim.tv_nsec > a->fts_statp->st_atim.tv_nsec) return (1); - else if (b->fts_statp->st_atimensec < a->fts_statp->st_atimensec) + else if (b->fts_statp->st_atim.tv_nsec < a->fts_statp->st_atim.tv_nsec) return (-1); else return (namecmp(a, b)); @@ -106,9 +106,9 @@ revacccmp(const FTSENT *a, const FTSENT *b) return (-1); else if (b->fts_statp->st_atime < a->fts_statp->st_atime) return (1); - else if (b->fts_statp->st_atimensec > a->fts_statp->st_atimensec) + else if (b->fts_statp->st_atim.tv_nsec > a->fts_statp->st_atim.tv_nsec) return (-1); - else if (b->fts_statp->st_atimensec < a->fts_statp->st_atimensec) + else if (b->fts_statp->st_atim.tv_nsec < a->fts_statp->st_atim.tv_nsec) return (1); else return (revnamecmp(a, b)); @@ -121,9 +121,9 @@ statcmp(const FTSENT *a, const FTSENT *b) return (1); else if (b->fts_statp->st_ctime < a->fts_statp->st_ctime) return (-1); - else if (b->fts_statp->st_ctimensec > a->fts_statp->st_ctimensec) + else if (b->fts_statp->st_ctim.tv_nsec > a->fts_statp->st_ctim.tv_nsec) return (1); - else if (b->fts_statp->st_ctimensec < a->fts_statp->st_ctimensec) + else if (b->fts_statp->st_ctim.tv_nsec < a->fts_statp->st_ctim.tv_nsec) return (-1); else return (namecmp(a, b)); @@ -136,9 +136,9 @@ revstatcmp(const FTSENT *a, const FTSENT *b) return (-1); else if (b->fts_statp->st_ctime < a->fts_statp->st_ctime) return (1); - else if (b->fts_statp->st_ctimensec > a->fts_statp->st_ctimensec) + else if (b->fts_statp->st_ctim.tv_nsec > a->fts_statp->st_ctim.tv_nsec) return (-1); - else if (b->fts_statp->st_ctimensec < a->fts_statp->st_ctimensec) + else if (b->fts_statp->st_ctim.tv_nsec < a->fts_statp->st_ctim.tv_nsec) return (1); else return (revnamecmp(a, b)); -- cgit v1.2.3