From: Mike Yuan Date: Sat, 15 Jun 2024 11:15:08 +0000 (+0200) Subject: core/cgroup: make unit_has_host_root_cgroup take const Unit* X-Git-Tag: v257-rc1~1014^2~8 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4442aef08e0fe8ba381b580455f7eb281c5a28a1;p=thirdparty%2Fsystemd.git core/cgroup: make unit_has_host_root_cgroup take const Unit* --- diff --git a/src/core/cgroup.c b/src/core/cgroup.c index 9296a5e4acb..41d7dd5adaf 100644 --- a/src/core/cgroup.c +++ b/src/core/cgroup.c @@ -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. */ diff --git a/src/core/cgroup.h b/src/core/cgroup.h index d258bcb3ae4..08fccf96126 100644 --- a/src/core/cgroup.h +++ b/src/core/cgroup.h @@ -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);