]> go.fuhry.dev Git - fsnotify.git/commitdiff
kqueue: watch for rename events on subdirectories
author铁哥 <guotie.9@gmail.com>
Tue, 30 Jun 2015 06:22:22 +0000 (14:22 +0800)
committerNathan Youngman <git@nathany.com>
Tue, 17 Nov 2015 21:12:18 +0000 (14:12 -0700)
if flags has no  syscall.NOTE_RENAME, subdir rename event will not notify.

closes #83

CHANGELOG.md
kqueue.go

index b9e0fcb990b92c97343802219aa54ad9e3e03f00..d0ede67573f0c3bf141ad92b82f4d79f6d68b774 100644 (file)
@@ -4,6 +4,7 @@
 
 * inotify: use epoll_create1 for arm64 support (requires Linux 2.6.27 or later) [#100](https://github.com/go-fsnotify/fsnotify/pull/100) (thanks @suihkulokki)
 * inotify: fix path leaks [#73](https://github.com/go-fsnotify/fsnotify/pull/73) (thanks @chamaken)
+* kqueue: watch for rename events on subdirectories [#83](https://github.com/go-fsnotify/fsnotify/pull/83) (thanks @guotie)
 
 ## v1.2.1 / 2015-10-14
 
index f8a364df9cfcb78830f330336604ff15c664f6a0..821955f2885024246b2da2df807624ad179061f0 100644 (file)
--- a/kqueue.go
+++ b/kqueue.go
@@ -417,7 +417,7 @@ func (w *Watcher) internalWatch(name string, fileInfo os.FileInfo) error {
                flags := w.dirFlags[name]
                w.mu.Unlock()
 
-               flags |= syscall.NOTE_DELETE
+               flags |= syscall.NOTE_DELETE | syscall.NOTE_RENAME
                return w.addWatch(name, flags)
        }