From 272d2e9376277cf55b019f0a76d86848898ec793 Mon Sep 17 00:00:00 2001 From: Michal Schmidt <mschmidt@redhat.com> Date: Fri, 20 Apr 2012 02:48:24 +0200 Subject: [PATCH] transaction: avoid garbage collecting the anchor job Make sure the anchor job is never considered garbage, even if it has no links leading to it (this will be allowed in the next patch). (cherry picked from commit 38809d9dfed4c75d9e97c4e5da2ff957723c4cad) --- src/core/transaction.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/transaction.c b/src/core/transaction.c index cac58e6..ddb02c0 100644 --- a/src/core/transaction.c +++ b/src/core/transaction.c @@ -454,7 +454,7 @@ static void transaction_collect_garbage(Transaction *tr) { again = false; HASHMAP_FOREACH(j, tr->jobs, i) { - if (j->object_list) { + if (tr->anchor_job == j || j->object_list) { /* log_debug("Keeping job %s/%s because of %s/%s", */ /* j->unit->id, job_type_to_string(j->type), */ /* j->object_list->subject ? j->object_list->subject->unit->id : "root", */