Skip to content

Commit a0da8e2

Browse files
author
Mrunal Patel
authored
Merge pull request #1360 from hqhq/remove_unused_systemd_func
Remove unused function in systemd cgroup
2 parents 49a33c4 + 8773c5f commit a0da8e2

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

libcontainer/cgroups/systemd/apply_systemd.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ package systemd
55
import (
66
"errors"
77
"fmt"
8-
"io/ioutil"
98
"os"
109
"path/filepath"
1110
"strings"
@@ -334,15 +333,6 @@ func (m *Manager) GetPaths() map[string]string {
334333
return paths
335334
}
336335

337-
func writeFile(dir, file, data string) error {
338-
// Normally dir should not be empty, one case is that cgroup subsystem
339-
// is not mounted, we will get empty dir, and we want it fail here.
340-
if dir == "" {
341-
return fmt.Errorf("no such directory for %s", file)
342-
}
343-
return ioutil.WriteFile(filepath.Join(dir, file), []byte(data), 0700)
344-
}
345-
346336
func join(c *configs.Cgroup, subsystem string, pid int) (string, error) {
347337
path, err := getSubsystemPath(c, subsystem)
348338
if err != nil {

0 commit comments

Comments
 (0)