This fixes the issue where you watch directory and then its
subdirectory, the subdirectory does not have all its files watched (via
watchDirectoryFiles)
w.paths[watchfd] = path
w.finfo[watchfd] = fi
- if fi.IsDir() && (flags&NOTE_WRITE) == NOTE_WRITE {
- watchDir = true
- }
}
+
+ if w.finfo[watchfd].IsDir() && (flags&NOTE_WRITE) == NOTE_WRITE {
+ watchDir = true
+ }
+
syscall.SetKevent(watchEntry, watchfd, syscall.EVFILT_VNODE, syscall.EV_ADD|syscall.EV_CLEAR)
wd, errno := syscall.Kevent(w.kq, w.kbuf[:], nil, nil)