From: Nathan Youngman Date: Sun, 22 Jun 2014 03:56:05 +0000 (-0600) Subject: inotify: remove internal addWatch X-Git-Tag: v1.7.2~308^2~2 X-Git-Url: https://go.fuhry.dev/?a=commitdiff_plain;h=af42df28d8db29f4339eb58c1972367fbf92af73;p=fsnotify.git inotify: remove internal addWatch --- diff --git a/fsnotify_linux.go b/fsnotify_linux.go index 591b055..fbec6da 100644 --- a/fsnotify_linux.go +++ b/fsnotify_linux.go @@ -95,13 +95,14 @@ func (w *Watcher) Close() error { return nil } -// AddWatch adds path to the watched file set. -// The flags are interpreted as described in inotify_add_watch(2). -func (w *Watcher) addWatch(path string, flags uint32) error { +// Add starts watching on the named file. +func (w *Watcher) Add(path string) error { if w.isClosed { return errors.New("inotify instance already closed") } + var flags uint32 = sys_AGNOSTIC_EVENTS + w.mu.Lock() watchEntry, found := w.watches[path] w.mu.Unlock() @@ -122,11 +123,6 @@ func (w *Watcher) addWatch(path string, flags uint32) error { return nil } -// Add starts watching on the named file. -func (w *Watcher) Add(path string) error { - return w.addWatch(path, sys_AGNOSTIC_EVENTS) -} - // Remove stops watching on the named file. func (w *Watcher) Remove(path string) error { w.mu.Lock()