Fix BlockUntilExists for relative paths.

filepath.Dir("foo") returns ".", so the inotify events are of the form
"./foo", which is not equal to the filename being watched ("foo")
This commit is contained in:
David Sansome 2015-09-29 18:02:16 +10:00
parent 0da4e86639
commit 760f3e6edc
1 changed files with 1 additions and 1 deletions

View File

@ -46,7 +46,7 @@ func (fw *InotifyFileWatcher) BlockUntilExists(t *tomb.Tomb) error {
case evt, ok := <-fw.w.Event:
if !ok {
return fmt.Errorf("inotify watcher has been closed")
} else if evt.Name == fw.Filename {
} else if filepath.Base(evt.Name) == filepath.Base(fw.Filename) {
return nil
}
case <-t.Dying():