From 9224f792f055a48348a5a770cac4c6f727d28d36 Mon Sep 17 00:00:00 2001 From: Andrew Gaul Date: Sun, 30 Jan 2022 22:19:15 +0900 Subject: [PATCH] Use CLOCK_REALTIME for UTIME_NOW (#1881) Previously s3fs_utimens used CLOCK_MONOTONIC_COARSE which was not 1970-based. Found via pjdfstest. References #1589. --- src/s3fs.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/s3fs.cpp b/src/s3fs.cpp index 2cf7340..9050e75 100644 --- a/src/s3fs.cpp +++ b/src/s3fs.cpp @@ -1966,7 +1966,7 @@ static int s3fs_utimens(const char* _path, const struct timespec ts[2]) } struct timespec now; - if(-1 == clock_gettime(static_cast(CLOCK_MONOTONIC_COARSE), &now)){ + if(-1 == clock_gettime(static_cast(CLOCK_REALTIME), &now)){ abort(); } #if __APPLE__ @@ -2088,7 +2088,7 @@ static int s3fs_utimens_nocopy(const char* _path, const struct timespec ts[2]) } struct timespec now; - if(-1 == clock_gettime(static_cast(CLOCK_MONOTONIC_COARSE), &now)){ + if(-1 == clock_gettime(static_cast(CLOCK_REALTIME), &now)){ abort(); } #if __APPLE__