core/cgroup: CGContext must be available if Unit has CGRuntime

Follow-up for e03e5056db
This commit is contained in:
Mike Yuan
2025-12-27 20:14:56 +01:00
parent 0afbf1a8aa
commit e4c43ca7d6
2 changed files with 4 additions and 7 deletions
+3 -4
View File
@@ -5141,12 +5141,11 @@ int unit_setup_exec_runtime(Unit *u) {
return r;
}
CGroupRuntime *unit_setup_cgroup_runtime(Unit *u) {
size_t offset;
CGroupRuntime* unit_setup_cgroup_runtime(Unit *u) {
assert(u);
assert(UNIT_HAS_CGROUP_CONTEXT(u));
offset = UNIT_VTABLE(u)->cgroup_runtime_offset;
size_t offset = UNIT_VTABLE(u)->cgroup_runtime_offset;
assert(offset > 0);
CGroupRuntime **rt = (CGroupRuntime**) ((uint8_t*) u + offset);