From: Lennart Poettering Date: Wed, 21 Apr 2010 01:15:58 +0000 (+0200) Subject: cgroup: only delete empty cgroups X-Git-Tag: 0.git+20100605+dfd8ee-1~102 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c9106f61d0755dc6b8aa7c4252baa140c2d473f1;p=systemd cgroup: only delete empty cgroups --- diff --git a/cgroup.c b/cgroup.c index f5c2592c..565ce24c 100644 --- a/cgroup.c +++ b/cgroup.c @@ -118,17 +118,15 @@ void cgroup_bonding_free(CGroupBonding *b) { hashmap_remove(b->unit->meta.manager->cgroup_bondings, b->path); } - free(b->controller); - free(b->path); - if (b->cgroup) { - - if (b->only_us && b->clean_up) - cgroup_delete_cgroup(b->cgroup, true); + if (b->only_us && b->clean_up && cgroup_bonding_is_empty(b) > 0) + cgroup_delete_cgroup_ext(b->cgroup, true); cgroup_free(&b->cgroup); } + free(b->controller); + free(b->path); free(b); }