From 6346f9270698f64f5081c8da18fe93798c064c8e Mon Sep 17 00:00:00 2001 From: xiaoqidun Date: Wed, 28 Jan 2026 20:58:12 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81):=20?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/fs/symfs_windows.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/internal/fs/symfs_windows.go b/internal/fs/symfs_windows.go index f3e68f6..f72046e 100644 --- a/internal/fs/symfs_windows.go +++ b/internal/fs/symfs_windows.go @@ -41,8 +41,8 @@ func errno(err error) int { if err == nil { return 0 } - if errno, ok := err.(syscall.Errno); ok { - return -int(errno) + if sysErr, ok := err.(syscall.Errno); ok { + return -int(sysErr) } return -int(fuse.ENOENT) } @@ -164,11 +164,13 @@ func (s *SymFS) Chown(path string, uid uint32, gid uint32) int { // 入参: path 路径, tmsp 时间戳数组 // 返回: int 错误码 func (s *SymFS) Utimens(path string, tmsp []fuse.Timespec) int { + if len(tmsp) < 2 { + return -int(fuse.EINVAL) + } path = s.realPath(path) atime := time.Unix(tmsp[0].Sec, tmsp[0].Nsec) mtime := time.Unix(tmsp[1].Sec, tmsp[1].Nsec) - err := os.Chtimes(path, atime, mtime) - return errno(err) + return errno(os.Chtimes(path, atime, mtime)) } // Access 检查文件访问权限