]> go.fuhry.dev Git - fsnotify.git/commitdiff
BSD: pass on errors
authorChris Howey <chris@howey.me>
Tue, 18 Oct 2011 12:56:03 +0000 (05:56 -0700)
committerChris Howey <chris@howey.me>
Tue, 18 Oct 2011 12:56:03 +0000 (05:56 -0700)
fsnotify_bsd.go

index d9d77541d7080fb3e8947613ade07687445c188c..f94c27ce29102f53c8986191910e924e1107fb8a 100644 (file)
@@ -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)