From 38c52d4606c77ff2b2b60a08f663a1983d8254b0 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 20 Apr 2011 03:53:12 +0200 Subject: cgroup: don't accidentaly trim on reload https://bugzilla.redhat.com/show_bug.cgi?id=678555 --- src/cgroup.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/cgroup.c') diff --git a/src/cgroup.c b/src/cgroup.c index ca19a4fd47..0c6f20d4b7 100644 --- a/src/cgroup.c +++ b/src/cgroup.c @@ -63,7 +63,7 @@ int cgroup_bonding_realize_list(CGroupBonding *first) { return 0; } -void cgroup_bonding_free(CGroupBonding *b) { +void cgroup_bonding_free(CGroupBonding *b, bool remove_or_trim) { assert(b); if (b->unit) { @@ -82,7 +82,7 @@ void cgroup_bonding_free(CGroupBonding *b) { } } - if (b->realized && b->ours) { + if (b->realized && b->ours && remove_or_trim) { if (cgroup_bonding_is_empty(b) > 0) cg_delete(b->controller, b->path); @@ -95,11 +95,11 @@ void cgroup_bonding_free(CGroupBonding *b) { free(b); } -void cgroup_bonding_free_list(CGroupBonding *first) { +void cgroup_bonding_free_list(CGroupBonding *first, bool remove_or_trim) { CGroupBonding *b, *n; LIST_FOREACH_SAFE(by_unit, b, n, first) - cgroup_bonding_free(b); + cgroup_bonding_free(b, remove_or_trim); } void cgroup_bonding_trim(CGroupBonding *b, bool delete_root) { -- cgit v1.2.3-54-g00ecf