From: Chris Howey Date: Tue, 18 Oct 2011 12:56:03 +0000 (-0700) Subject: BSD: pass on errors X-Git-Tag: v1.7.2~457 X-Git-Url: https://go.fuhry.dev/?a=commitdiff_plain;h=cf26feea14dcfd6cd5817b5db1e0bd3148e29e12;p=fsnotify.git BSD: pass on errors --- diff --git a/fsnotify_bsd.go b/fsnotify_bsd.go index d9d7754..f94c27c 100644 --- a/fsnotify_bsd.go +++ b/fsnotify_bsd.go @@ -249,7 +249,10 @@ func (w *Watcher) sendDirectoryChangeEvents(dirPath string) { filePath := path.Join(dirPath, fileInfo.Name) if w.watches[filePath] == 0 { // Watch file to mimic linux fsnotify - w.addWatch(filePath, NOTE_DELETE|NOTE_WRITE|NOTE_RENAME) + e := w.addWatch(filePath, NOTE_DELETE|NOTE_WRITE|NOTE_RENAME) + if e != nil { + w.Error <- e + } // Send create event fileEvent := new(FileEvent)