fix: BlockUntilExists should only return if filename matches

This commit is contained in:
Sridhar Ratnakumar 2012-10-12 17:30:45 -07:00
parent 507783a4a0
commit adcb2e389d
1 changed files with 6 additions and 1 deletions

View File

@ -36,7 +36,12 @@ func (fw *InotifyFileWatcher) BlockUntilExists() error {
return err return err
} }
defer w.RemoveWatch(filepath.Dir(fw.Filename)) defer w.RemoveWatch(filepath.Dir(fw.Filename))
<-w.Event for {
evt := <-w.Event
if evt.Name == fw.Filename {
break
}
}
return nil return nil
} }