summaryrefslogtreecommitdiffhomepage
path: root/runsc/cmd/kill.go
diff options
context:
space:
mode:
authorAyush Ranjan <ayushranjan@google.com>2021-03-06 22:04:58 -0800
committergVisor bot <gvisor-bot@google.com>2021-03-06 22:07:07 -0800
commite668288fafe378ab4dc7fbb23ac933a15a2fff94 (patch)
tree4b75b894e723f7fc9014e50e2b66e5b2c0bb75a8 /runsc/cmd/kill.go
parent0a909ba75a556db6acbb2a30d2e741b365217c83 (diff)
[op] Replace syscall package usage with golang.org/x/sys/unix in runsc/.
The syscall package has been deprecated in favor of golang.org/x/sys. Note that syscall is still used in some places because the following don't seem to have an equivalent in unix package: - syscall.SysProcIDMap - syscall.Credential Updates #214 PiperOrigin-RevId: 361381490
Diffstat (limited to 'runsc/cmd/kill.go')
-rw-r--r--runsc/cmd/kill.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/runsc/cmd/kill.go b/runsc/cmd/kill.go
index e0df39266..239fc7ac2 100644
--- a/runsc/cmd/kill.go
+++ b/runsc/cmd/kill.go
@@ -19,7 +19,6 @@ import (
"fmt"
"strconv"
"strings"
- "syscall"
"github.com/google/subcommands"
"golang.org/x/sys/unix"
@@ -99,10 +98,10 @@ func (k *Kill) Execute(_ context.Context, f *flag.FlagSet, args ...interface{})
return subcommands.ExitSuccess
}
-func parseSignal(s string) (syscall.Signal, error) {
+func parseSignal(s string) (unix.Signal, error) {
n, err := strconv.Atoi(s)
if err == nil {
- sig := syscall.Signal(n)
+ sig := unix.Signal(n)
for _, msig := range signalMap {
if sig == msig {
return sig, nil
@@ -116,7 +115,7 @@ func parseSignal(s string) (syscall.Signal, error) {
return -1, fmt.Errorf("unknown signal %q", s)
}
-var signalMap = map[string]syscall.Signal{
+var signalMap = map[string]unix.Signal{
"ABRT": unix.SIGABRT,
"ALRM": unix.SIGALRM,
"BUS": unix.SIGBUS,