]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core/cgroup: make unit_has_host_root_cgroup take const Unit*
authorMike Yuan <me@yhndnzj.com>
Sat, 15 Jun 2024 11:15:08 +0000 (13:15 +0200)
committerMike Yuan <me@yhndnzj.com>
Fri, 28 Jun 2024 13:38:42 +0000 (15:38 +0200)
src/core/cgroup.c
src/core/cgroup.h

index 9296a5e4acbd6893989c5177b882ecfdc450a1f0..41d7dd5adaf8a9a3bebf51d2487fb2912b9f3cd4 100644 (file)
@@ -102,8 +102,9 @@ bool unit_has_startup_cgroup_constraints(Unit *u) {
                c->startup_memory_low_set;
 }
 
-bool unit_has_host_root_cgroup(Unit *u) {
+bool unit_has_host_root_cgroup(const Unit *u) {
         assert(u);
+        assert(u->manager);
 
         /* Returns whether this unit manages the root cgroup. This will return true if this unit is the root slice and
          * the manager manages the root cgroup. */
index d258bcb3ae485745c1e4e6c39bfc98d7615336bb..08fccf96126a632ba1cd7d8dd7dee6c464100ae7 100644 (file)
@@ -503,7 +503,7 @@ int unit_reset_accounting(Unit *u);
         })
 
 bool manager_owns_host_root_cgroup(Manager *m);
-bool unit_has_host_root_cgroup(Unit *u);
+bool unit_has_host_root_cgroup(const Unit *u);
 
 bool unit_has_startup_cgroup_constraints(Unit *u);