Fix errcheck: error return value of `cmd.Cmd.Process.Signal` is not checked

Signed-off-by: Jan Rodák <hony.com@seznam.cz>
This commit is contained in:
Jan Rodák 2024-07-01 15:00:04 +02:00
parent b48c88b66f
commit 7b11e7e338
No known key found for this signature in database
GPG Key ID: E82E2FA0E160318E
1 changed files with 6 additions and 1 deletions

View File

@ -590,7 +590,12 @@ func MaybeReexecUsingUserNamespace(evenForRoot bool) {
cmd.Hook = func(int) error { cmd.Hook = func(int) error {
go func() { go func() {
for receivedSignal := range interrupted { for receivedSignal := range interrupted {
cmd.Cmd.Process.Signal(receivedSignal) if err := cmd.Cmd.Process.Signal(receivedSignal); err != nil {
logrus.Warnf(
"Failed to send a signal '%d' to the Process (PID: %d): %v",
receivedSignal, cmd.Cmd.Process.Pid, err,
)
}
} }
}() }()
return nil return nil