Changes the path clean to absolute path

This commit is contained in:
Nino Khodabandeh 2016-04-04 15:51:37 -07:00
parent e43dce6dc1
commit 0ea51b0fd6
1 changed files with 10 additions and 1 deletions

View File

@ -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():