chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
sd-daemon: fix #include lines since we now ship a shared library
[elogind.git]
/
src
/
cgroup.c
diff --git
a/src/cgroup.c
b/src/cgroup.c
index be837c3d0f940f9e069c51dfc99862af774b9030..4bbb54fd7e41a17f96ea8f3b651cc43aa8e5f089 100644
(file)
--- a/
src/cgroup.c
+++ b/
src/cgroup.c
@@
-363,7
+363,8
@@
int cgroup_notify_empty(Manager *m, const char *group) {
assert(m);
assert(group);
assert(m);
assert(group);
- if (!(l = hashmap_get(m->cgroup_bondings, group)))
+ l = hashmap_get(m->cgroup_bondings, group);
+ if (!l)
return 0;
LIST_FOREACH(by_path, b, l) {
return 0;
LIST_FOREACH(by_path, b, l) {
@@
-372,7
+373,8
@@
int cgroup_notify_empty(Manager *m, const char *group) {
if (!b->unit)
continue;
if (!b->unit)
continue;
- if ((t = cgroup_bonding_is_empty_list(b)) < 0) {
+ t = cgroup_bonding_is_empty_list(b);
+ if (t < 0) {
/* If we don't know, we don't know */
if (t != -EAGAIN)
/* If we don't know, we don't know */
if (t != -EAGAIN)
@@
-381,9
+383,13
@@
int cgroup_notify_empty(Manager *m, const char *group) {
continue;
}
continue;
}
- if (t > 0)
+ if (t > 0) {
+ /* If it is empty, let's delete it */
+ cgroup_bonding_trim_list(b->unit->meta.cgroup_bondings, true);
+
if (UNIT_VTABLE(b->unit)->cgroup_notify_empty)
UNIT_VTABLE(b->unit)->cgroup_notify_empty(b->unit);
if (UNIT_VTABLE(b->unit)->cgroup_notify_empty)
UNIT_VTABLE(b->unit)->cgroup_notify_empty(b->unit);
+ }
}
return 0;
}
return 0;