Skip to content

Commit

Permalink
fix for incorrect mtime handling (#3121)
Browse files Browse the repository at this point in the history
  • Loading branch information
ebozduman authored Mar 18, 2020
1 parent fc04dc6 commit 91da0da
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cmd/client-fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
Expand Down

0 comments on commit 91da0da

Please sign in to comment.