fix for incorrect mtime handling (#3121)

This commit is contained in:
ebozduman
2020-03-18 11:33:53 -07:00
committed by GitHub
parent fc04dc6463
commit 91da0da183
+3 -3
View File
@@ -392,13 +392,13 @@ func (f *fsClient) put(reader io.Reader, size int64, metadata map[string][]strin
return totalWritten, probe.NewError(e)
}
ctime, e := strconv.ParseInt(attr["ctime"], 10, 64)
mtime, e := strconv.ParseInt(attr["mtime"], 10, 64)
if e != nil {
return totalWritten, probe.NewError(e)
}
// Attempt to change the access, modify and change time
if e := os.Chtimes(objectPath, time.Unix(atime, 0), time.Unix(ctime, 0)); e != nil {
// Attempt to change the access and modify time
if e := os.Chtimes(objectPath, time.Unix(atime, 0), time.Unix(mtime, 0)); e != nil {
return totalWritten, probe.NewError(e)
}
}