Skip to content

Commit

Permalink
Restores error propagation from fsnotify.Watcher.Add.
Browse files Browse the repository at this point in the history
  • Loading branch information
Vlad Losev committed Mar 21, 2017
1 parent 669c440 commit 2e79377
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion watch/inotify.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func (fw *InotifyFileWatcher) ChangeEvents(t *tomb.Tomb, pos int64) (*FileChange
//With an open fd, unlink(fd) - inotify returns IN_ATTRIB (==fsnotify.Chmod)
case evt.Op&fsnotify.Chmod == fsnotify.Chmod:
if _, err := os.Stat(fw.Filename); err != nil {
if ! os.IsNotExist(err) {
if !os.IsNotExist(err) {
return
}
}
Expand Down
4 changes: 3 additions & 1 deletion watch/inotify_tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,9 @@ func (shared *InotifyTracker) addWatch(winfo *watchInfo) error {
if shared.watchNums[fname] == 0 {
err = shared.watcher.Add(fname)
}
shared.watchNums[fname]++
if err == nil {
shared.watchNums[fname]++
}
return err
}

Expand Down

0 comments on commit 2e79377

Please sign in to comment.