]> go.fuhry.dev Git - fsnotify.git/commitdiff
inotify: remove internal addWatch
authorNathan Youngman <git@nathany.com>
Sun, 22 Jun 2014 03:56:05 +0000 (21:56 -0600)
committerNathan Youngman <git@nathany.com>
Sun, 22 Jun 2014 03:56:05 +0000 (21:56 -0600)
fsnotify_linux.go

index 591b055dba1e92b3f3e273ce7c338eaea7baeca2..fbec6da6745cf9026cffb0c8418a0629330f2d57 100644 (file)
@@ -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()