Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(auditbeat/fim/fsnotify): do not return error immediately as this …
Browse files Browse the repository at this point in the history
…causes losing events on mac
pkoutsovasilis authored and dliappis committed May 2, 2024
1 parent 9e713ad commit 9209cf5
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion auditbeat/module/file_integrity/monitor/monitor_test.go
Original file line number Diff line number Diff line change
@@ -192,7 +192,7 @@ func TestRecursiveSubdirPermissions(t *testing.T) {

ev, err := readTimeout(t, watcher)
assert.Equal(t, errReadTimeout, err)
if err != errReadTimeout {
if !errors.Is(err, errReadTimeout) {
t.Fatalf("Expected timeout, got event %+v", ev)
}

4 changes: 2 additions & 2 deletions auditbeat/module/file_integrity/monitor/recursive.go
Original file line number Diff line number Diff line change
@@ -113,11 +113,11 @@ func (watcher *recursiveWatcher) addRecursive(path string) error {
return nil
}

var errs multierror.Errors
if err := watcher.watchFile(path, nil); err != nil {
return fmt.Errorf("failed adding watcher to '%s': %w", path, err)
errs = append(errs, fmt.Errorf("failed adding watcher to '%s': %w", path, err))
}

var errs multierror.Errors
err := filepath.Walk(path, func(walkPath string, info os.FileInfo, fnErr error) error {
if walkPath == path {
return nil

0 comments on commit 9209cf5

Please sign in to comment.