diff options
author | Lennart Poettering <lennart@poettering.net> | 2013-07-02 16:24:13 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2013-07-02 16:24:13 +0200 |
commit | 06025d9148036ee4de9866f3f067ffa75e14a751 (patch) | |
tree | cca40de59ee620b061a7101176b3657d6525a79e /src/core/cgroup.c | |
parent | 8aec412ff697bc14995746953912ca6fdf2c9ba8 (diff) |
core: don't consider a unit's cgroup empty if only a subcgroup runs empty
Diffstat (limited to 'src/core/cgroup.c')
-rw-r--r-- | src/core/cgroup.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/core/cgroup.c b/src/core/cgroup.c index cdccf3ff15..c7f1e77c6c 100644 --- a/src/core/cgroup.c +++ b/src/core/cgroup.c @@ -728,16 +728,15 @@ int manager_notify_cgroup_empty(Manager *m, const char *cgroup) { assert(m); assert(cgroup); - r = cg_is_empty_recursive(SYSTEMD_CGROUP_CONTROLLER, cgroup, true); - if (r == 0) - return 0; - u = manager_get_unit_by_cgroup(m, cgroup); if (u) { - if (UNIT_VTABLE(u)->notify_cgroup_empty) - UNIT_VTABLE(u)->notify_cgroup_empty(u); + r = cg_is_empty_recursive(SYSTEMD_CGROUP_CONTROLLER, u->cgroup_path, true); + if (r > 0) { + if (UNIT_VTABLE(u)->notify_cgroup_empty) + UNIT_VTABLE(u)->notify_cgroup_empty(u); - unit_add_to_gc_queue(u); + unit_add_to_gc_queue(u); + } } return 0; |