Use CLOCK_REALTIME for UTIME_NOW (#1881)

Previously s3fs_utimens used CLOCK_MONOTONIC_COARSE which was not
1970-based.  Found via pjdfstest.  References #1589.
This commit is contained in:
Andrew Gaul 2022-01-30 22:19:15 +09:00 committed by GitHub
parent f6ed972926
commit 9224f792f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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<clockid_t>(CLOCK_MONOTONIC_COARSE), &now)){
if(-1 == clock_gettime(static_cast<clockid_t>(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<clockid_t>(CLOCK_MONOTONIC_COARSE), &now)){
if(-1 == clock_gettime(static_cast<clockid_t>(CLOCK_REALTIME), &now)){
abort();
}
#if __APPLE__