diff options
author | Bruno Haible <bruno@clisp.org> | 2021-01-06 06:16:22 +0100 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2021-01-06 06:16:22 +0100 |
commit | 05bee3e887988e9dd5e12ffde2334ee152e7c7e0 (patch) | |
tree | a8b5303b70c255e53030c35eb84f6a58c9eda624 /lib/utimecmp.c | |
parent | 9333dcf67b904820e442634077ecfe285b363c1a (diff) | |
download | gnulib-05bee3e887988e9dd5e12ffde2334ee152e7c7e0.tar.gz |
utimens, utimensat, fdutimensat: Avoid test failures on AIX 7.2.
* lib/utimecmp.c (utimecmpat): On AIX, declare equality when the two
times differ by less than 0.01 seconds.
* tests/test-futimens.h (test_futimens): Pass UTIMECMP_TRUNCATE_SOURCE
flag.
Diffstat (limited to 'lib/utimecmp.c')
-rw-r--r-- | lib/utimecmp.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/utimecmp.c b/lib/utimecmp.c index 7f73925ae9..781a0d2892 100644 --- a/lib/utimecmp.c +++ b/lib/utimecmp.c @@ -157,6 +157,17 @@ utimecmpat (int dfd, char const *dst_name, if (options & UTIMECMP_TRUNCATE_SOURCE) { +#if defined _AIX + /* On AIX 7.2, on a jfs2 file system, the times may differ by up to + 0.01 seconds in either direction. But it does not seem to come + from clock ticks of 0.01 seconds each. */ + long long difference = + ((long long) dst_s - (long long) src_s) * BILLION + + ((long long) dst_ns - (long long) src_ns); + if (difference < 10000000 && difference > -10000000) + return 0; +#endif + /* Look up the timestamp resolution for the destination device. */ /* Hash table for caching information learned about devices. */ |