mirror of
https://github.com/troglobit/finit.git
synced 2026-10-08 08:24:43 +07: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:
+3
-1
@@ -231,7 +231,9 @@ static struct cg *append(char *path)
|
||||
|
||||
snprintf(fn, sizeof(fn), "%s/cpu.stat", path);
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user