From aef98a6c7b84d0be08f62d7a8213e9722b7560de Mon Sep 17 00:00:00 2001 From: Evan Phoenix Date: Wed, 14 Oct 2015 10:50:51 -0700 Subject: [PATCH] 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 --- CHANGELOG.md | 4 ++++ kqueue.go | 5 +++++ 2 files changed, 9 insertions(+) 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 -- 2.50.1