Skip to content

Commit ce99518

Browse files
committed
cgroup: using WriteCgroupProc to write the specified pid into the cgroup's cgroup.procs file
cgroupData.join method using `WriteCgroupProc` to place the pid into the proc file, it can avoid attach any pid to the cgroup if -1 is specified as a pid. so, replace `writeFile` with `WriteCgroupProc` like `cpuset.go`'s ApplyDir method. Signed-off-by: Wang Long <[email protected]>
1 parent ce5d8cf commit ce99518

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libcontainer/cgroups/fs/cpu.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ func (s *CpuGroup) ApplyDir(path string, cgroup *configs.Cgroup, pid int) error
4646
}
4747
// because we are not using d.join we need to place the pid into the procs file
4848
// unlike the other subsystems
49-
if err := writeFile(path, "cgroup.procs", strconv.Itoa(pid)); err != nil {
49+
if err := cgroups.WriteCgroupProc(path, pid); err != nil {
5050
return err
5151
}
5252

0 commit comments

Comments
 (0)