cgroup-util: debug log if /proc/self/ns/cgroup is not available for unexpected reasons

This commit is contained in:
Lennart Poettering 2018-10-24 17:25:11 +02:00
parent 0d76d772d1
commit 0887fa711c
1 changed files with 6 additions and 4 deletions

View File

@ -129,10 +129,12 @@ bool cg_ns_supported(void) {
if (enabled >= 0)
return enabled;
if (access("/proc/self/ns/cgroup", F_OK) == 0)
enabled = 1;
else
enabled = 0;
if (access("/proc/self/ns/cgroup", F_OK) < 0) {
if (errno != ENOENT)
log_debug_errno(errno, "Failed to check whether /proc/self/ns/cgroup is available, assuming not: %m");
enabled = false;
} else
enabled = true;
return enabled;
}