From 0ea51b0fd64dab07813494c4db3b126cd6b0e1f3 Mon Sep 17 00:00:00 2001 From: Nino Khodabandeh Date: Mon, 4 Apr 2016 15:51:37 -0700 Subject: [PATCH] Changes the path clean to absolute path --- watch/inotify.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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():