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

View File

@@ -11,7 +11,6 @@ import (
"os/exec"
"path/filepath"
"strconv"
"syscall" // only for Signal
"github.com/opencontainers/runc/libcontainer/cgroups"
"github.com/opencontainers/runc/libcontainer/configs"
@@ -76,7 +75,7 @@ func (p *setnsProcess) startTime() (uint64, error) {
}
func (p *setnsProcess) signal(sig os.Signal) error {
s, ok := sig.(syscall.Signal)
s, ok := sig.(unix.Signal)
if !ok {
return errors.New("os: unsupported signal type")
}
@@ -506,7 +505,7 @@ func (p *initProcess) createNetworkInterfaces() error {
}
func (p *initProcess) signal(sig os.Signal) error {
s, ok := sig.(syscall.Signal)
s, ok := sig.(unix.Signal)
if !ok {
return errors.New("os: unsupported signal type")
}