mirror of
https://github.com/DominicBreuker/pspy.git
synced 2025-12-21 11:44:51 +00:00
refactor inotify implementation
This commit is contained in:
@@ -4,7 +4,6 @@ import (
|
||||
"fmt"
|
||||
|
||||
"github.com/dominicbreuker/pspy/internal/fswatcher/inotify"
|
||||
isys "github.com/dominicbreuker/pspy/internal/fswatcher/inotify/sys"
|
||||
"github.com/dominicbreuker/pspy/internal/fswatcher/walker"
|
||||
)
|
||||
|
||||
@@ -17,7 +16,7 @@ func (iw *InotifyWatcher) Close() {
|
||||
}
|
||||
|
||||
func NewInotifyWatcher() (*InotifyWatcher, error) {
|
||||
i, err := inotify.NewInotify(&isys.InotifySyscallsUNIX{})
|
||||
i, err := inotify.NewInotify()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("setting up inotify: %v", err)
|
||||
}
|
||||
@@ -27,7 +26,7 @@ func NewInotifyWatcher() (*InotifyWatcher, error) {
|
||||
}
|
||||
|
||||
func (iw *InotifyWatcher) Setup(rdirs, dirs []string, errCh chan error) (chan struct{}, chan string, error) {
|
||||
maxWatchers, err := getLimit()
|
||||
maxWatchers, err := inotify.GetMaxWatchers()
|
||||
if err != nil {
|
||||
errCh <- fmt.Errorf("Can't get inotify watcher limit...: %v\n", err)
|
||||
maxWatchers = -1
|
||||
|
||||
Reference in New Issue
Block a user