diff --git a/watch/inotify.go b/watch/inotify.go index 76870d6..d86e724 100644 --- a/watch/inotify.go +++ b/watch/inotify.go @@ -45,7 +45,16 @@ func (fw *InotifyFileWatcher) BlockUntilExists(t *tomb.Tomb) error { case evt, ok := <-events: if !ok { return fmt.Errorf("inotify watcher has been closed") - } else if filepath.Clean(evt.Name) == fw.Filename { + } + evtName, err := filepath.Abs(evt.Name) + if err != nil { + return err + } + fwFilename, err := filepath.Abs(fw.Filename) + if err != nil { + return err + } + if evtName == fwFilename { return nil } case <-t.Dying():