Merge pull request #17 from presbrey/patch-1

fix race/panic on modify+delete
This commit is contained in:
Sridhar Ratnakumar 2013-09-23 11:58:53 -07:00
commit c9444e81ae
1 changed files with 4 additions and 0 deletions

View File

@ -97,6 +97,10 @@ func (fw *InotifyFileWatcher) ChangeEvents(t tomb.Tomb, fi os.FileInfo) *FileCha
case evt.IsModify(): case evt.IsModify():
fi, err := os.Stat(fw.Filename) fi, err := os.Stat(fw.Filename)
if err != nil { if err != nil {
if os.IsNotExist(err) {
changes.NotifyDeleted()
return
}
// XXX: no panic here // XXX: no panic here
panic(err) panic(err)
} }