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:
Joachim Wiberg
2021-03-22 10:47:52 +01:00
parent 9f98b1d3d1
commit c0ae7763a6
+3 -1
View File
@@ -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;
}