0039-pax-Only-use-_PC_TIMESTAMP_RESOLUTION-if-it-is-defin.patch (1304B)
- From 7977b9211356095517951e86fa53f64c6b27e16b Mon Sep 17 00:00:00 2001
- From: Michael Forney <mforney@mforney.org>
- Date: Tue, 29 Apr 2025 16:50:16 -0700
- Subject: [PATCH] pax: Only use _PC_TIMESTAMP_RESOLUTION if it is defined
- ---
- bin/pax/ar_subs.c | 6 +++++-
- 1 file changed, 5 insertions(+), 1 deletion(-)
- diff --git a/bin/pax/ar_subs.c b/bin/pax/ar_subs.c
- index 4c49efa1362..a0e4fdfdea5 100644
- --- a/bin/pax/ar_subs.c
- +++ b/bin/pax/ar_subs.c
- @@ -167,12 +167,13 @@ cmp_file_times(int mtime_flag, int ctime_flag, ARCHD *arcn, const char *path)
- else if (timespeccmp(&arcn->sb.st_mtim, &sb.st_mtim, <=))
- return 1;
- +#ifdef _PC_TIMESTAMP_RESOLUTION
- /*
- * If we got here then the target arcn > sb for mtime *and* that's
- * the deciding factor. Check whether they're equal after rounding
- * down the arcn mtime to the precision of the target path.
- */
- - res = pathconfat(AT_FDCWD, path, _PC_TIMESTAMP_RESOLUTION,
- + res = pathconf(path, _PC_TIMESTAMP_RESOLUTION,
- AT_SYMLINK_NOFOLLOW);
- if (res == -1)
- return 0;
- @@ -195,6 +196,9 @@ cmp_file_times(int mtime_flag, int ctime_flag, ARCHD *arcn, const char *path)
- return ((arcn->sb.st_mtime / res) * res) <= sb.st_mtime;
- return arcn->sb.st_mtime <= ((sb.st_mtime / res) * res);
- }
- +#else
- + return 0;
- +#endif
- }
- /*
- --
- 2.49.0