From: Evan Phoenix Date: Wed, 14 Oct 2015 17:50:51 +0000 (-0700) Subject: Don't watch named pipes X-Git-Tag: v1.7.2~219 X-Git-Url: https://go.fuhry.dev/?a=commitdiff_plain;h=aef98a6c7b84d0be08f62d7a8213e9722b7560de;p=fsnotify.git Don't watch named pipes You can't watch a named pipe, same as a socket. The call to `Open` will just hang forever. closes #98 --- diff --git a/CHANGELOG.md b/CHANGELOG.md index ea9428a..9b52489 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## master + +* kqueue: don't watch named pipes [#98](https://github.com/go-fsnotify/fsnotify/pull/98) (thanks @evanphx) + ## v1.2.0 / 2015-02-08 * inotify: use epoll to wake up readEvents [#66](https://github.com/go-fsnotify/fsnotify/pull/66) (thanks @PieterD) diff --git a/kqueue.go b/kqueue.go index 265622d..f8a364d 100644 --- a/kqueue.go +++ b/kqueue.go @@ -181,6 +181,11 @@ func (w *Watcher) addWatch(name string, flags uint32) error { return nil } + // Don't watch named pipes. + if fi.Mode()&os.ModeNamedPipe == os.ModeNamedPipe { + return nil + } + // Follow Symlinks // Unfortunately, Linux can add bogus symlinks to watch list without // issue, and Windows can't do symlinks period (AFAIK). To maintain