From 0c75a63184e1f0b374d09690ff34e1a259bebe94 Mon Sep 17 00:00:00 2001 From: Andrew Gaul Date: Sun, 30 Jan 2022 21:45:51 +0900 Subject: [PATCH] Preserve sub-second precision with utimens (#1880) Found via pjdfstest. References #1589. --- src/s3fs.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/s3fs.cpp b/src/s3fs.cpp index 6896172..2cf7340 100644 --- a/src/s3fs.cpp +++ b/src/s3fs.cpp @@ -2004,9 +2004,9 @@ static int s3fs_utimens(const char* _path, const struct timespec ts[2]) } }else{ headers_t updatemeta; - updatemeta["x-amz-meta-mtime"] = str(mtime.tv_sec); - updatemeta["x-amz-meta-ctime"] = str(actime.tv_sec); - updatemeta["x-amz-meta-atime"] = str(actime.tv_sec); + updatemeta["x-amz-meta-mtime"] = str(mtime); + updatemeta["x-amz-meta-ctime"] = str(actime); + updatemeta["x-amz-meta-atime"] = str(actime); updatemeta["x-amz-copy-source"] = urlEncode(service_path + bucket + get_realpath(strpath.c_str())); updatemeta["x-amz-metadata-directive"] = "REPLACE";