Skip to content

Commit

Permalink
Merge pull request #18 from 0x0916/remove-unnecessary-checks
Browse files Browse the repository at this point in the history
BACKPORT: kill.go: Remove unnecessary checks
  • Loading branch information
runcom authored Dec 11, 2018
2 parents 290a336 + 852bbec commit fa3195e
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions kill.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,7 @@ signal to the init process of the "ubuntu01" container:
func parseSignal(rawSignal string) (syscall.Signal, error) {
s, err := strconv.Atoi(rawSignal)
if err == nil {
sig := syscall.Signal(s)
for _, msig := range signalMap {
if sig == msig {
return sig, nil
}
}
return -1, fmt.Errorf("unknown signal %q", rawSignal)
return syscall.Signal(s), nil
}
signal, ok := signalMap[strings.TrimPrefix(strings.ToUpper(rawSignal), "SIG")]
if !ok {
Expand Down

0 comments on commit fa3195e

Please sign in to comment.