mirror of
https://github.com/troglobit/finit.git
synced 2026-11-07 16:01:08 +00:00
initctl: ignore possibly missing cpu.stat in cgroup2 root
Older kernels (4.19) don't have the summary cpu.stat in the cgroup2 root, so let's ignore that problem and return zero. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
1 parent
9f98b1d3d1
commit
c0ae7763a6
1 file changed
+3
-1
+3
-1
@@ -231,7 +231,9 @@ static struct cg *append(char *path)
|
|||||||
|
|
||||||
snprintf(fn, sizeof(fn), "%s/cpu.stat", path);
|
snprintf(fn, sizeof(fn), "%s/cpu.stat", path);
|
||||||
if (access(fn, F_OK)) {
|
if (access(fn, F_OK)) {
|
||||||
warn("not a cgroup path with cpu controller, %s", path);
|
/* older kernels, 4.19, don't have summary cpu.stat in root */
|
||||||
|
if (strcmp(path, FINIT_CGPATH))
|
||||||
|
warn("not a cgroup path with cpu controller, %s", path);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user