Compare commits

..

No commits in common. "ef24d7980c50f706286d99ab6d80a98af89970e3" and "be27f006859dec9eb8e3f980b378ca01f53d82ca" have entirely different histories.

2 changed files with 7 additions and 10 deletions

1
.gitignore vendored
View File

@ -2,7 +2,6 @@
/hid/hid /hid/hid
/hnc/hnc /hnc/hnc
/hpcu/hpcu /hpcu/hpcu
/hswg/hswg
/ht/ht /ht/ht
/prototypes/tls-autodetect /prototypes/tls-autodetect
/prototypes/xgb-draw /prototypes/xgb-draw

View File

@ -334,15 +334,6 @@ func dispatchEvents(dirname string, r io.Reader, ch chan<- *watchEvent) error {
return err return err
} }
base := make([]byte, e.Len)
if e.Len != 0 {
if n, err := r.Read(base); err != nil {
return err
} else if n < int(e.Len) {
return fmt.Errorf("short read")
}
}
switch { switch {
case e.Mask&syscall.IN_IGNORED != 0: case e.Mask&syscall.IN_IGNORED != 0:
return fmt.Errorf("watch removed by kernel") return fmt.Errorf("watch removed by kernel")
@ -354,6 +345,13 @@ func dispatchEvents(dirname string, r io.Reader, ch chan<- *watchEvent) error {
continue continue
} }
base := make([]byte, e.Len)
if n, err := r.Read(base); err != nil {
return err
} else if n < int(e.Len) {
return fmt.Errorf("short read")
}
basename, interesting := string(base[:bytes.IndexByte(base, 0)]), false basename, interesting := string(base[:bytes.IndexByte(base, 0)]), false
for _, glob := range globs { for _, glob := range globs {
if matches, _ := filepath.Match(glob, basename); matches { if matches, _ := filepath.Match(glob, basename); matches {