From 8773c5f9a6127a0f8f5be4c18964ef3fb70e620c Mon Sep 17 00:00:00 2001 From: Qiang Huang Date: Tue, 7 Mar 2017 15:11:37 +0800 Subject: [PATCH] Remove unused function in systemd cgroup Signed-off-by: Qiang Huang --- libcontainer/cgroups/systemd/apply_systemd.go | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/libcontainer/cgroups/systemd/apply_systemd.go b/libcontainer/cgroups/systemd/apply_systemd.go index 7ce066c06..a9b722699 100644 --- a/libcontainer/cgroups/systemd/apply_systemd.go +++ b/libcontainer/cgroups/systemd/apply_systemd.go @@ -5,7 +5,6 @@ package systemd import ( "errors" "fmt" - "io/ioutil" "os" "path/filepath" "strings" @@ -334,15 +333,6 @@ func (m *Manager) GetPaths() map[string]string { return paths } -func writeFile(dir, file, data string) error { - // Normally dir should not be empty, one case is that cgroup subsystem - // is not mounted, we will get empty dir, and we want it fail here. - if dir == "" { - return fmt.Errorf("no such directory for %s", file) - } - return ioutil.WriteFile(filepath.Join(dir, file), []byte(data), 0700) -} - func join(c *configs.Cgroup, subsystem string, pid int) (string, error) { path, err := getSubsystemPath(c, subsystem) if err != nil {