]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
cgroup: rework cg_all_unified() 5444/head
authorLennart Poettering <lennart@poettering.net>
Fri, 24 Feb 2017 17:05:31 +0000 (18:05 +0100)
committerLennart Poettering <lennart@poettering.net>
Fri, 24 Feb 2017 17:05:31 +0000 (18:05 +0100)
Let's just check the unified level, directly. There's really no value in
wrapping cg_unified_controllers() with this, i.e. potentially do string
comparison when there's no reason to.

Also, this makes the clal more alike cg_hybrid_unified().

src/basic/cgroup-util.c

index c20a00a07a1f131c8ade847d8eabaa8dc7d64a58..bda5c555ad38fe6e2e069e4b23670a7508c29753 100644 (file)
@@ -2409,7 +2409,13 @@ int cg_unified_controller(const char *controller) {
 }
 
 int cg_all_unified(void) {
-        return cg_unified_controller(NULL);
+        int r;
+
+        r = cg_unified_update();
+        if (r < 0)
+                return r;
+
+        return unified_cache >= CGROUP_UNIFIED_ALL;
 }
 
 int cg_hybrid_unified(void) {