chiark / gitweb /
Prep v233: Unmask now needed functions in src/basic
[elogind.git] / src / basic / cgroup-util.c
index a0947b8c5851e20508e07ceecdc8a05d14ba0e22..40e09d6f90605741351531363fe6a208ec3adae9 100644 (file)
@@ -2409,7 +2409,7 @@ static thread_local CGroupUnified unified_cache = CGROUP_UNIFIED_UNKNOWN;
  */
 static thread_local bool unified_systemd_v232;
 
-static int cg_update_unified(void) {
+static int cg_unified_update(void) {
 
         struct statfs fs;
 
@@ -2460,7 +2460,7 @@ static int cg_update_unified(void) {
 int cg_unified_controller(const char *controller) {
         int r;
 
-        r = cg_update_unified();
+        r = cg_unified_update();
         if (r < 0)
                 return r;
 
@@ -2474,14 +2474,20 @@ 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;
 }
 
 #if 0 /// UNNEEDED by elogind
 int cg_hybrid_unified(void) {
         int r;
 
-        r = cg_update_unified();
+        r = cg_unified_update();
         if (r < 0)
                 return r;
 
@@ -2491,7 +2497,7 @@ int cg_hybrid_unified(void) {
 int cg_unified_flush(void) {
         unified_cache = CGROUP_UNIFIED_UNKNOWN;
 
-        return cg_update_unified();
+        return cg_unified_update();
 }
 
 int cg_enable_everywhere(CGroupMask supported, CGroupMask mask, const char *p) {