nit: do not use syscall package

In many places (not all of them though) we can use `unix.`
instead of `syscall.` as these are indentical.

In particular, x/sys/unix defines:

```go
type Signal = syscall.Signal
type Errno = syscall.Errno
type SysProcAttr = syscall.SysProcAttr

const ENODEV      = syscall.Errno(0x13)
```

and unix.Exec() calls syscall.Exec().

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
Kir Kolyshkin
2020-04-18 16:05:10 -07:00
parent bf0a8e1747
commit af6b9e7fa9
9 changed files with 17 additions and 26 deletions
+3 -4
View File
@@ -6,7 +6,6 @@ import (
"fmt"
"strconv"
"strings"
"syscall"
"github.com/urfave/cli"
"golang.org/x/sys/unix"
@@ -23,7 +22,7 @@ Where "<container-id>" is the name for the instance of the container and
EXAMPLE:
For example, if the container id is "ubuntu01" the following will send a "KILL"
signal to the init process of the "ubuntu01" container:
# runc kill ubuntu01 KILL`,
Flags: []cli.Flag{
cli.BoolFlag{
@@ -56,10 +55,10 @@ signal to the init process of the "ubuntu01" container:
},
}
func parseSignal(rawSignal string) (syscall.Signal, error) {
func parseSignal(rawSignal string) (unix.Signal, error) {
s, err := strconv.Atoi(rawSignal)
if err == nil {
return syscall.Signal(s), nil
return unix.Signal(s), nil
}
sig := strings.ToUpper(rawSignal)
if !strings.HasPrefix(sig, "SIG") {