fix regression #48
When watching a directory with kqueue, fsnotify will watch all the files in it. This includes subdirectories, but it only watches for the subdirectory being deleted. This is to emulate the behavior of inotify on Linux.
A bug in
4a0d1ae9df8c61fb8912829fc714f189358a3dc7 resulted in it watching that subdirectory for all events, so watching a single directory would result in more events than expected.
# Changelog
-## dev / 2014-09-24
+## dev / 2014-12-12
* kqueue: rework internals [#43](https://github.com/go-fsnotify/fsnotify/pull/43)
* add low-level functions
* done can be an unbuffered channel
* remove calls to os.NewSyscallError
* More efficient string concatenation for Event.String() [#52](https://github.com/go-fsnotify/fsnotify/pull/52) (thanks @mdlayher)
+* kqueue: fix regression in rework causing subdirectories to be watched [#48](https://github.com/go-fsnotify/fsnotify/issues/48)
## v1.0.4 / 2014-09-07
}
const registerAdd = syscall.EV_ADD | syscall.EV_CLEAR | syscall.EV_ENABLE
- if err := register(w.kq, []int{watchfd}, registerAdd, noteAllEvents); err != nil {
+ if err := register(w.kq, []int{watchfd}, registerAdd, flags); err != nil {
syscall.Close(watchfd)
return err
}