Skip to content

Commit

Permalink
fix: 修复错误提示信息
Browse files Browse the repository at this point in the history
  • Loading branch information
rehiy committed Dec 24, 2023
1 parent bcd6832 commit 2485f00
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions module/worker/recv_filer.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ func (pod *RecvPod) Filer(rq *socket.PlainData) error {
ret.FileList = []*filer.FileInfo{info}
case "write":
err = filer.Write(data.Path, data.File.Data)
if data.File.Mode > 0 {
if err == nil && data.File.Mode > 0 {
err = os.Chmod(data.Path, data.File.Mode)
}
if data.File.ModTime > 0 {
if err == nil && data.File.ModTime > 0 {
mtime := time.Unix(data.File.ModTime, 0)
os.Chtimes(data.Path, mtime, mtime)
err = os.Chtimes(data.Path, mtime, mtime)
}
case "chmod":
err = os.Chmod(data.Path, data.File.Mode)
Expand Down

0 comments on commit 2485f00

Please sign in to comment.