cgroups: rework check whether legacy hierarchy is writable

parent ddd51bd1
...@@ -3077,8 +3077,11 @@ static bool unified_hierarchy_delegated(int dfd_base, char ***ret_files) ...@@ -3077,8 +3077,11 @@ static bool unified_hierarchy_delegated(int dfd_base, char ***ret_files)
static bool legacy_hierarchy_delegated(int dfd_base) static bool legacy_hierarchy_delegated(int dfd_base)
{ {
if (faccessat(dfd_base, "cgroup.procs", W_OK, 0) && errno != ENOENT) int ret;
return sysinfo_ret(false, "The cgroup.procs file is not writable, skipping legacy hierarchy");
ret = faccessat(dfd_base, ".", W_OK, 0);
if (ret < 0 && errno != ENOENT)
return sysinfo_ret(false, "Legacy hierarchy not writable, skipping");
return true; return true;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment