Compare commits

...

2 Commits

Author SHA1 Message Date
xiaoqidun eeff36d167 feat(修复问题): 修复问题
/ build (push) Successful in -53s
2026-02-24 11:33:03 +08:00
xiaoqidun 6612fcca2e fix(修复问题): 修复问题 2026-02-24 11:29:18 +08:00
+14 -1
View File
@@ -253,7 +253,13 @@ func (s *SymFS) Write(path string, buff []byte, ofst int64, fh uint64) int {
// 入参: path 路径, fh 文件句柄
// 返回: int 错误码
func (s *SymFS) Flush(path string, fh uint64) int {
syscall.FlushFileBuffers(syscall.Handle(fh))
err := syscall.FlushFileBuffers(syscall.Handle(fh))
if err != nil {
if sysErr, ok := err.(syscall.Errno); ok && sysErr == syscall.ERROR_ACCESS_DENIED {
return 0
}
return errno(err)
}
return 0
}
@@ -459,9 +465,16 @@ func (s *SymFS) watch() {
if err != nil {
return
}
headerSize := uint32(unsafe.Offsetof(FileNotifyInformation{}.FileName))
var offset uint32
for {
if offset+headerSize > bytesReturned {
break
}
info := (*FileNotifyInformation)(unsafe.Pointer(&buf[offset]))
if offset+headerSize+info.FileNameLength > bytesReturned {
break
}
length := info.FileNameLength / 2
nameSlice := (*[1 << 16]uint16)(unsafe.Pointer(&info.FileName[0]))[:length:length]
fileName := syscall.UTF16ToString(nameSlice)