logo

oasis

Own branch of Oasis Linux (upstream: <https://git.sr.ht/~mcf/oasis/>) git clone https://anongit.hacktivis.me/git/oasis.git

0039-pax-Only-use-_PC_TIMESTAMP_RESOLUTION-if-it-is-defin.patch (1304B)


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