From 9e78b66e88fd4c29777414d23ee154e08f9509fb Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Thu, 24 Sep 2020 16:37:26 -0700 Subject: [PATCH] libct/cg/systemd/v1.enableKmem: use fscommon.ReadFile Signed-off-by: Kir Kolyshkin --- libcontainer/cgroups/systemd/v1.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libcontainer/cgroups/systemd/v1.go b/libcontainer/cgroups/systemd/v1.go index eeda18a90..2d85fdefd 100644 --- a/libcontainer/cgroups/systemd/v1.go +++ b/libcontainer/cgroups/systemd/v1.go @@ -4,7 +4,6 @@ package systemd import ( "errors" - "io/ioutil" "os" "path/filepath" "strings" @@ -13,6 +12,7 @@ import ( systemdDbus "github.com/coreos/go-systemd/v22/dbus" "github.com/opencontainers/runc/libcontainer/cgroups" "github.com/opencontainers/runc/libcontainer/cgroups/fs" + "github.com/opencontainers/runc/libcontainer/cgroups/fscommon" "github.com/opencontainers/runc/libcontainer/configs" "github.com/sirupsen/logrus" ) @@ -415,7 +415,7 @@ func enableKmem(c *configs.Cgroup) error { } // do not try to enable the kernel memory if we already have // tasks in the cgroup. - content, err := ioutil.ReadFile(filepath.Join(path, "tasks")) + content, err := fscommon.ReadFile(path, "tasks") if err != nil { return err }