}
wd, errno := syscall.InotifyAddWatch(w.fd, path, flags)
if wd == -1 {
- return os.NewSyscallError("inotify_add_watch", errno)
+ return &os.PathError{"inotify_add_watch", path, os.Errno(errno)}
}
if !found {
t.Fatalf("NewWatcher() failed: %s", err)
}
- // Add a watch for "_obj"
- err = watcher.Watch("_obj")
+ // Add a watch for "_test"
+ err = watcher.Watch("_test")
if err != nil {
t.Fatalf("Watcher.Watch() failed: %s", err)
}
}
}()
- const testFile string = "_obj/TestInotifyEvents.testfile"
+ const testFile string = "_test/TestInotifyEvents.testfile"
// Receive events on the event channel on a separate goroutine
eventstream := watcher.Event
t.Fatal("double Close() test failed: second Close() call didn't return")
}
- err := watcher.Watch("_obj")
+ err := watcher.Watch("_test")
if err == nil {
t.Fatal("expected error on Watch() after Close(), got nil")
}