diff options
author | Sascha Grunert <sgrunert@suse.com> | 2020-01-21 16:08:26 +0100 |
---|---|---|
committer | Sascha Grunert <sgrunert@suse.com> | 2020-01-21 16:08:29 +0100 |
commit | 2511b508009918c4b20620cead2ef5dd48129069 (patch) | |
tree | 1894169da49a3b853f31b5b9fdbb0fcaa0343f3a /pkg/cgroups/cgroups_supported.go | |
parent | 9be64300d46341ab345f8c760b7a79cced7db3f9 (diff) | |
download | podman-2511b508009918c4b20620cead2ef5dd48129069.tar.gz podman-2511b508009918c4b20620cead2ef5dd48129069.tar.bz2 podman-2511b508009918c4b20620cead2ef5dd48129069.zip |
Use cgroupv2 super magic from golang.org/x/sys/unix
We can use this constant from the already existing sys/unix package
instead of defining it by our own.
Signed-off-by: Sascha Grunert <sgrunert@suse.com>
Diffstat (limited to 'pkg/cgroups/cgroups_supported.go')
-rw-r--r-- | pkg/cgroups/cgroups_supported.go | 3 |
1 files changed, 2 insertions, 1 deletions
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 |