termux-packages/root-packages/runc/cg-cpuset-noprefix-compat.p...

46 lines
1.7 KiB
Diff

--- ./libcontainer/cgroups/fs/cpuset.go.orig 2020-01-22 17:19:15.000000000 +0100
+++ ./libcontainer/cgroups/fs/cpuset.go 2020-02-22 21:17:22.474879849 +0100
@@ -32,12 +32,12 @@
func (s *CpusetGroup) Set(path string, cgroup *configs.Cgroup) error {
if cgroup.Resources.CpusetCpus != "" {
- if err := fscommon.WriteFile(path, "cpuset.cpus", cgroup.Resources.CpusetCpus); err != nil {
+ if err := fscommon.WriteFile(path, "cpus", cgroup.Resources.CpusetCpus); err != nil {
return err
}
}
if cgroup.Resources.CpusetMems != "" {
- if err := fscommon.WriteFile(path, "cpuset.mems", cgroup.Resources.CpusetMems); err != nil {
+ if err := fscommon.WriteFile(path, "mems", cgroup.Resources.CpusetMems); err != nil {
return err
}
}
@@ -89,10 +89,10 @@
}
func (s *CpusetGroup) getSubsystemSettings(parent string) (cpus []byte, mems []byte, err error) {
- if cpus, err = ioutil.ReadFile(filepath.Join(parent, "cpuset.cpus")); err != nil {
+ if cpus, err = ioutil.ReadFile(filepath.Join(parent, "cpus")); err != nil {
return
}
- if mems, err = ioutil.ReadFile(filepath.Join(parent, "cpuset.mems")); err != nil {
+ if mems, err = ioutil.ReadFile(filepath.Join(parent, "mems")); err != nil {
return
}
return cpus, mems, nil
@@ -136,12 +136,12 @@
}
if s.isEmpty(currentCpus) {
- if err := fscommon.WriteFile(current, "cpuset.cpus", string(parentCpus)); err != nil {
+ if err := fscommon.WriteFile(current, "cpus", string(parentCpus)); err != nil {
return err
}
}
if s.isEmpty(currentMems) {
- if err := fscommon.WriteFile(current, "cpuset.mems", string(parentMems)); err != nil {
+ if err := fscommon.WriteFile(current, "mems", string(parentMems)); err != nil {
return err
}
}