summaryrefslogtreecommitdiffhomepage
path: root/runsc/cgroup/cgroup.go
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2021-03-07 06:11:49 +0000
committergVisor bot <gvisor-bot@google.com>2021-03-07 06:11:49 +0000
commit05c2d6c038777818932d3991c0de9cfa2a7bea51 (patch)
tree2a394d8666124ff8188b0c945854e2b7e3281217 /runsc/cgroup/cgroup.go
parent2fa12b2aa91ba00211df440f5e6a64e45a2ecb91 (diff)
parente668288fafe378ab4dc7fbb23ac933a15a2fff94 (diff)
Merge release-20210301.0-22-ge668288fa (automated)
Diffstat (limited to 'runsc/cgroup/cgroup.go')
-rw-r--r--runsc/cgroup/cgroup.go9
1 files changed, 4 insertions, 5 deletions
diff --git a/runsc/cgroup/cgroup.go b/runsc/cgroup/cgroup.go
index ac9e4e3a8..438b7ef3e 100644
--- a/runsc/cgroup/cgroup.go
+++ b/runsc/cgroup/cgroup.go
@@ -27,7 +27,6 @@ import (
"path/filepath"
"strconv"
"strings"
- "syscall"
"time"
"github.com/cenkalti/backoff"
@@ -111,7 +110,7 @@ func setValue(path, name, data string) error {
err := ioutil.WriteFile(fullpath, []byte(data), 0700)
if err == nil {
return nil
- } else if !errors.Is(err, syscall.EINTR) {
+ } else if !errors.Is(err, unix.EINTR) {
return err
}
}
@@ -161,7 +160,7 @@ func fillFromAncestor(path string) (string, error) {
err := ioutil.WriteFile(path, []byte(val), 0700)
if err == nil {
break
- } else if !errors.Is(err, syscall.EINTR) {
+ } else if !errors.Is(err, unix.EINTR) {
return "", err
}
}
@@ -337,7 +336,7 @@ func (c *Cgroup) Install(res *specs.LinuxResources) error {
c.Own[key] = true
if err := os.MkdirAll(path, 0755); err != nil {
- if cfg.optional && errors.Is(err, syscall.EROFS) {
+ if cfg.optional && errors.Is(err, unix.EROFS) {
log.Infof("Skipping cgroup %q", key)
continue
}
@@ -370,7 +369,7 @@ func (c *Cgroup) Uninstall() error {
defer cancel()
b := backoff.WithContext(backoff.NewConstantBackOff(100*time.Millisecond), ctx)
fn := func() error {
- err := syscall.Rmdir(path)
+ err := unix.Rmdir(path)
if os.IsNotExist(err) {
return nil
}