From e5e0c80fdfa8861931df799574d5a60c96b6aa13 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 18 Apr 2018 14:20:49 +0200 Subject: util-lib: introduce new empty_or_root() helper (#8746) We check the same condition at various places. Let's add a trivial, common helper for this, and use it everywhere. It's not going to make things much faster or much shorter, but I think a lot more readable --- src/core/cgroup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/core') diff --git a/src/core/cgroup.c b/src/core/cgroup.c index c52bdbf15..9b69fa82e 100644 --- a/src/core/cgroup.c +++ b/src/core/cgroup.c @@ -40,7 +40,7 @@ bool manager_owns_root_cgroup(Manager *m) { if (detect_container() > 0) return false; - return isempty(m->cgroup_root) || path_equal(m->cgroup_root, "/"); + return empty_or_root(m->cgroup_root); } #if 0 /// UNNEEDED by elogind -- cgit v1.2.3