Skip to content

Commit 9a270e2

Browse files
Merge pull request #1706 from unshare/pr-2
kill.go: Remove unnecessary checks
2 parents c4e4bb0 + 7ac503d commit 9a270e2

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

kill.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,7 @@ signal to the init process of the "ubuntu01" container:
6161
func parseSignal(rawSignal string) (syscall.Signal, error) {
6262
s, err := strconv.Atoi(rawSignal)
6363
if err == nil {
64-
sig := syscall.Signal(s)
65-
for _, msig := range signalMap {
66-
if sig == msig {
67-
return sig, nil
68-
}
69-
}
70-
return -1, fmt.Errorf("unknown signal %q", rawSignal)
64+
return syscall.Signal(s), nil
7165
}
7266
signal, ok := signalMap[strings.TrimPrefix(strings.ToUpper(rawSignal), "SIG")]
7367
if !ok {

0 commit comments

Comments
 (0)