X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fcore%2Fscope.c;h=f0efec051646d9851625c8ef1efe712dfaf5d7e7;hb=c09da72900b03fcddade06643f24c6357f3e0482;hp=d33b8919568b230c1d96b7028347cf954ab80c54;hpb=23bbb0de4e3f85d9704a5c12a5afa2dfa0159e41;p=elogind.git diff --git a/src/core/scope.c b/src/core/scope.c index d33b89195..f0efec051 100644 --- a/src/core/scope.c +++ b/src/core/scope.c @@ -382,15 +382,14 @@ static int scope_deserialize_item(Unit *u, const char *key, const char *value, F } static bool scope_check_gc(Unit *u) { - Scope *s = SCOPE(u); - int r; - - assert(s); + assert(u); /* Never clean up scopes that still have a process around, * even if the scope is formally dead. */ if (u->cgroup_path) { + int r; + r = cg_is_empty_recursive(SYSTEMD_CGROUP_CONTROLLER, u->cgroup_path, true); if (r <= 0) return true;