summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-04-22 02:41:14 +0200
committerLennart Poettering <lennart@poettering.net>2010-04-22 02:41:14 +0200
commitc9c0cadbf8d8e4c1b99c35a8150c08558f361ebd (patch)
treec491abe527fb12b2dedb178a22fac6f0d6d1961f
parent15ae422b7471cf6f41ccf450243d8afd8ea0a054 (diff)
manager: fix GC logic
-rw-r--r--manager.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/manager.c b/manager.c
index f10345b43a..5cb5c3d2d2 100644
--- a/manager.c
+++ b/manager.c
@@ -405,7 +405,7 @@ static void unit_gc_sweep(Unit *u, int gc_marker) {
u->meta.gc_marker == -gc_marker)
return;
- if (!u->meta.in_cleanup_queue)
+ if (u->meta.in_cleanup_queue)
goto bad;
if (unit_check_gc(u))
@@ -441,8 +441,10 @@ static unsigned manager_dispatch_gc_queue(Manager *m) {
log_debug("Running GC...");
- gc_marker = m->gc_marker;
- m->gc_marker = MIN(0, m->gc_marker + 1);
+ gc_marker = ++m->gc_marker;
+
+ if (m->gc_marker < 0)
+ m->gc_marker = 1;
while ((meta = m->gc_queue)) {
assert(meta->in_gc_queue);