Merge pull request #216 from cbosdo/master

cgroups: Export ParseCgroupFile
This commit is contained in:
Victor Marmol 2014-10-08 10:51:49 +02:00
commit f4254672e6
2 changed files with 4 additions and 4 deletions

View File

@ -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)
}

View File

@ -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() {