From af42df28d8db29f4339eb58c1972367fbf92af73 Mon Sep 17 00:00:00 2001 From: Nathan Youngman Date: Sat, 21 Jun 2014 21:56:05 -0600 Subject: [PATCH] inotify: remove internal addWatch --- fsnotify_linux.go | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) 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() -- 2.50.1