Skip to content

Commit

Permalink
Do not show error if processes are terminated
Browse files Browse the repository at this point in the history
  • Loading branch information
Top-Ranger committed Mar 15, 2022
1 parent 8626ebe commit 452900c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,13 @@ func (r *rule) processScanner(n string, args ...string) (chan *match, error) {
log.Printf(`%s: error while scanning command "%s": %s`, r.name, cmd, err.Error())
}
if err = cmd.Wait(); err != nil {
var eerr *exec.ExitError
if errors.As(err, &eerr) {
if eerr.ProcessState.ExitCode() == -1 {
// Program was terminated by a signal - in this case, do not show an error message
return
}
}
log.Printf(`%s: error while executing command "%s": %s`, r.name, cmd, err.Error())
}
}()
Expand Down

0 comments on commit 452900c

Please sign in to comment.