]> go.fuhry.dev Git - fsnotify.git/commit
kqueue: avoid infinite loops from symlinks cycles
authorDaniel Wagner-Hall <dawagner@gmail.com>
Tue, 17 Nov 2015 06:24:26 +0000 (01:24 -0500)
committerNathan Youngman <git@nathany.com>
Tue, 17 Nov 2015 21:48:49 +0000 (14:48 -0700)
commit2cdd39bd6129c6a49c74fb07fb9d77ba1271c572
tree87fc30cd42aa1ce4e957bd3fd9bee0e0d733bfa1
parent79275569df67d5aa3d5d6a14b133a9fdb1e948e1
kqueue: avoid infinite loops from symlinks cycles

The semenatics of using kqueue are already slightly different than
inotify, specifically that inotify will give you events for the symlink
itself whereas kqueue will only give events for the target of the
symlink. This preserves that behaviour, that symlinks don't get notified
on, but ensures that circular symlinks don't recurse forever.

This change pushes the resolved filename up through the stack so that
the fileExists map can be properly populated; not doing so would mean
that deleting a cyclical symlink and then replacing it with a file of
the same name would not notify for that file's creation (or subsequent
events) because we would believe that the file already existed.
AUTHORS
CHANGELOG.md
integration_test.go
kqueue.go