From 2485f00dd9b6143111a2f678dac5aa2592485ecb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=A5=E6=B5=B7?= Date: Sun, 24 Dec 2023 10:32:51 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- module/worker/recv_filer.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/module/worker/recv_filer.go b/module/worker/recv_filer.go index 63a4d0c4..760f2f54 100644 --- a/module/worker/recv_filer.go +++ b/module/worker/recv_filer.go @@ -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)