From: Christian Brauner Date: Wed, 17 Feb 2021 09:06:29 +0000 (+0100) Subject: cgroups: don't rely on absolute path X-Git-Tag: lxc-5.0.0~281^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1e05885505522049a51bd9e26680607d321d892e;p=thirdparty%2Flxc.git cgroups: don't rely on absolute path Signed-off-by: Christian Brauner --- diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c index 0d32469e7..ddec3ad82 100644 --- a/src/lxc/cgroups/cgfsng.c +++ b/src/lxc/cgroups/cgfsng.c @@ -1225,6 +1225,11 @@ __cgfsng_ops static void cgfsng_monitor_destroy(struct cgroup_ops *ops, } conf = handler->conf; + if (!ops->monitor_cgroup) { + WARN("Uninitialized monitor cgroup"); + return; + } + len = strnprintf(pidstr, sizeof(pidstr), "%d", handler->monitor_pid); if (len < 0) return; @@ -1236,9 +1241,6 @@ __cgfsng_ops static void cgfsng_monitor_destroy(struct cgroup_ops *ops, bool cpuset_v1 = false; int ret; - if (!h->monitor_full_path) - continue; - /* Monitor might have died before we entered the cgroup. */ if (handler->monitor_pid <= 0) { WARN("No valid monitor process found while destroying cgroups");