From: Lennart Poettering Date: Wed, 24 Oct 2018 15:25:11 +0000 (+0200) Subject: cgroup-util: debug log if /proc/self/ns/cgroup is not available for unexpected reasons X-Git-Tag: v240~458^2~7 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0887fa711cc3ed63114ec53b4052a626f6929915;p=thirdparty%2Fsystemd.git cgroup-util: debug log if /proc/self/ns/cgroup is not available for unexpected reasons --- diff --git a/src/basic/cgroup-util.c b/src/basic/cgroup-util.c index 19723d30843..65ca6f2f504 100644 --- a/src/basic/cgroup-util.c +++ b/src/basic/cgroup-util.c @@ -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; }