Skip to content

Commit

Permalink
core/cgroup: make unit_has_host_root_cgroup take const Unit*
Browse files Browse the repository at this point in the history
(cherry picked from commit 4442aef08e0fe8ba381b580455f7eb281c5a28a1)
(cherry picked from commit 06c2ee39799064a82d2af1bee7a5c72ebdd66090)
  • Loading branch information
YHNdnzj authored and bluca committed Jul 24, 2024
1 parent 8fc5213 commit 00b495a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/core/cgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,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. */
Expand Down
2 changes: 1 addition & 1 deletion src/core/cgroup.h
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,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);

Expand Down

0 comments on commit 00b495a

Please sign in to comment.