mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-15 02:36:16 +02:00
Use getCurrentCgroup() in getMaxCPU()
This commit is contained in:
parent
03484641a1
commit
bd6ae2f3b9
1 changed files with 1 additions and 5 deletions
|
@ -32,11 +32,7 @@ unsigned int getMaxCPU()
|
|||
auto cgroupFS = getCgroupFS();
|
||||
if (!cgroupFS) return 0;
|
||||
|
||||
auto cgroups = getCgroups("/proc/self/cgroup");
|
||||
auto cgroup = cgroups[""];
|
||||
if (cgroup == "") return 0;
|
||||
|
||||
auto cpuFile = *cgroupFS + "/" + cgroup + "/cpu.max";
|
||||
auto cpuFile = *cgroupFS + "/" + getCurrentCgroup() + "/cpu.max";
|
||||
|
||||
auto cpuMax = readFile(cpuFile);
|
||||
auto cpuMaxParts = tokenizeString<std::vector<std::string>>(cpuMax, " \n");
|
||||
|
|
Loading…
Reference in a new issue