Preserve sub-second precision with utimens (#1880)

Found via pjdfstest.  References #1589.
This commit is contained in:
Andrew Gaul 2022-01-30 21:45:51 +09:00 committed by GitHub
parent 30cf7a50bb
commit 0c75a63184
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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";