diff options
author | Péter Szilágyi <peterke@gmail.com> | 2017-02-17 00:23:58 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-17 00:23:58 +0800 |
commit | bdef758d5c6d397584d0c35e53d6f6c318e61351 (patch) | |
tree | 0beb8c96c7bf6a5a82434ed79218e822927434c3 /vendor/github.com/rjeczalik/notify/watcher_kqueue.go | |
parent | c8695fae359aa327da9203a57ffaf4f2d47d4370 (diff) | |
parent | 2c4455b12aca82ccd29c05c1750c25430867e545 (diff) | |
download | dexon-bdef758d5c6d397584d0c35e53d6f6c318e61351.tar.gz dexon-bdef758d5c6d397584d0c35e53d6f6c318e61351.tar.zst dexon-bdef758d5c6d397584d0c35e53d6f6c318e61351.zip |
Merge pull request #3679 from fjl/vendor-govendor
vendor: update dependencies with github.com/kardianos/govendor
Diffstat (limited to 'vendor/github.com/rjeczalik/notify/watcher_kqueue.go')
-rw-r--r-- | vendor/github.com/rjeczalik/notify/watcher_kqueue.go | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/vendor/github.com/rjeczalik/notify/watcher_kqueue.go b/vendor/github.com/rjeczalik/notify/watcher_kqueue.go index d5f7788c4..6d500b700 100644 --- a/vendor/github.com/rjeczalik/notify/watcher_kqueue.go +++ b/vendor/github.com/rjeczalik/notify/watcher_kqueue.go @@ -157,14 +157,15 @@ func (k *kq) IsStop(n interface{}, err error) bool { } func init() { - encode = func(e Event) (o int64) { + encode = func(e Event, dir bool) (o int64) { // Create event is not supported by kqueue. Instead NoteWrite event will - // be registered. If this event will be reported on dir which is to be - // monitored for Create, dir will be rescanned and Create events will - // be generated and returned for new files. In case of files, - // if not requested NoteRename event is reported, it will be ignored. + // be registered for a directory. If this event will be reported on dir + // which is to be monitored for Create, dir will be rescanned + // and Create events will be generated and returned for new files. + // In case of files, if not requested NoteRename event is reported, + // it will be ignored. o = int64(e &^ Create) - if e&Write != 0 { + if (e&Create != 0 && dir) || e&Write != 0 { o = (o &^ int64(Write)) | int64(NoteWrite) } if e&Rename != 0 { |