From 06949e779fe4f45aa8f664441d2b1548707398cb Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Mon, 22 Sep 2014 18:01:58 +0200 Subject: [PATCH] pkg/cgroups: Export ParseCgroupFile This is needed for the libvirt exec driver. Docker-DCO-1.1-Signed-off-by: Alexander Larsson (github: alexlarsson) Docker-DCO-1.1-Signed-off-by: Josh Poimboeuf (github: jpoimboe) --- cgroups/cgroups_test.go | 2 +- cgroups/utils.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cgroups/cgroups_test.go b/cgroups/cgroups_test.go index 537336a4..e8c52938 100644 --- a/cgroups/cgroups_test.go +++ b/cgroups/cgroups_test.go @@ -20,7 +20,7 @@ const ( func TestParseCgroups(t *testing.T) { r := bytes.NewBuffer([]byte(cgroupsContents)) - _, err := parseCgroupFile("blkio", r) + _, err := ParseCgroupFile("blkio", r) if err != nil { t.Fatal(err) } diff --git a/cgroups/utils.go b/cgroups/utils.go index 5516c5a2..77a3c0d7 100644 --- a/cgroups/utils.go +++ b/cgroups/utils.go @@ -115,7 +115,7 @@ func GetThisCgroupDir(subsystem string) (string, error) { } defer f.Close() - return parseCgroupFile(subsystem, f) + return ParseCgroupFile(subsystem, f) } func GetInitCgroupDir(subsystem string) (string, error) { @@ -125,7 +125,7 @@ func GetInitCgroupDir(subsystem string) (string, error) { } defer f.Close() - return parseCgroupFile(subsystem, f) + return ParseCgroupFile(subsystem, f) } func ReadProcsFile(dir string) ([]int, error) { @@ -152,7 +152,7 @@ func ReadProcsFile(dir string) ([]int, error) { return out, nil } -func parseCgroupFile(subsystem string, r io.Reader) (string, error) { +func ParseCgroupFile(subsystem string, r io.Reader) (string, error) { s := bufio.NewScanner(r) for s.Scan() {