Skip to content

Commit

Permalink
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
  • Loading branch information
pkoutsovasilis committed May 2, 2024
1 parent 63b9aa5 commit eabfda2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion auditbeat/module/file_integrity/monitor/monitor_test.go
Expand Up @@ -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)
}

Expand Down
4 changes: 2 additions & 2 deletions auditbeat/module/file_integrity/monitor/recursive.go
Expand Up @@ -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
Expand Down

0 comments on commit eabfda2

Please sign in to comment.