simplify cgroup controller separation (#384)

master v1.1.3
Kevin Wan 4 years ago committed by GitHub
parent 8d6f6f933e
commit 744c18b7cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -92,12 +92,11 @@ func currentCgroup() (*cgroup, error) {
continue continue
} }
if strings.Contains(subsys, ",") { // https://man7.org/linux/man-pages/man7/cgroups.7.html
for _, k := range strings.Split(subsys, ",") { // comma-separated list of controllers for cgroup version 1
cgroups[k] = path.Join(cgroupDir, k) fields := strings.Split(subsys, ",")
} for _, val := range fields {
} else { cgroups[val] = path.Join(cgroupDir, val)
cgroups[subsys] = path.Join(cgroupDir, subsys)
} }
} }

Loading…
Cancel
Save