summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-01-22 15:54:32 -0500
committerGitHub <noreply@github.com>2020-01-22 15:54:32 -0500
commit8b377a79c240e4480339358db3b87263ec6cfef3 (patch)
treef57534fd15a79aa24f816d641fd8bc47213bbd59
parent94b53a2d4aaf8795506f7f778f11cb887056ff50 (diff)
parent2511b508009918c4b20620cead2ef5dd48129069 (diff)
downloadpodman-8b377a79c240e4480339358db3b87263ec6cfef3.tar.gz
podman-8b377a79c240e4480339358db3b87263ec6cfef3.tar.bz2
podman-8b377a79c240e4480339358db3b87263ec6cfef3.zip
Merge pull request #4920 from openSUSE/cgroup2-super-magic
Use cgroupv2 super magic from golang.org/x/sys/unix
-rw-r--r--pkg/cgroups/cgroups.go3
-rw-r--r--pkg/cgroups/cgroups_supported.go3
2 files changed, 3 insertions, 3 deletions
diff --git a/pkg/cgroups/cgroups.go b/pkg/cgroups/cgroups.go
index 6b28b2759..96786223d 100644
--- a/pkg/cgroups/cgroups.go
+++ b/pkg/cgroups/cgroups.go
@@ -97,8 +97,7 @@ type controllerHandler interface {
}
const (
- cgroupRoot = "/sys/fs/cgroup"
- _cgroup2SuperMagic = 0x63677270
+ cgroupRoot = "/sys/fs/cgroup"
// CPU is the cpu controller
CPU = "cpu"
// CPUAcct is the cpuacct controller
diff --git a/pkg/cgroups/cgroups_supported.go b/pkg/cgroups/cgroups_supported.go
index 2a36777d4..a9fef38b9 100644
--- a/pkg/cgroups/cgroups_supported.go
+++ b/pkg/cgroups/cgroups_supported.go
@@ -12,6 +12,7 @@ import (
"syscall"
"github.com/pkg/errors"
+ "golang.org/x/sys/unix"
)
var (
@@ -27,7 +28,7 @@ func IsCgroup2UnifiedMode() (bool, error) {
if err := syscall.Statfs("/sys/fs/cgroup", &st); err != nil {
isUnified, isUnifiedErr = false, err
} else {
- isUnified, isUnifiedErr = st.Type == _cgroup2SuperMagic, nil
+ isUnified, isUnifiedErr = st.Type == unix.CGROUP2_SUPER_MAGIC, nil
}
})
return isUnified, isUnifiedErr