summaryrefslogtreecommitdiff
path: root/src/core/transaction.c
diff options
context:
space:
mode:
authorMichal Schmidt <mschmidt@redhat.com>2012-04-20 10:33:37 +0200
committerMichal Schmidt <mschmidt@redhat.com>2012-04-20 17:12:28 +0200
commit4483f694983382b4092e3e295ffb59926cff96d9 (patch)
treed3bd9417e2f3f22adfbdc1c2fcf6b2a599489f32 /src/core/transaction.c
parentb94fbd30781d7533492cec65bf7d86fa19a1a074 (diff)
transaction: change the linking of isolate jobs to the anchor
When isolating, the JOB_STOP jobs have no parent job, so they are all peers of the real anchor job. This is a bit odd. Link them from the anchor job.
Diffstat (limited to 'src/core/transaction.c')
-rw-r--r--src/core/transaction.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/core/transaction.c b/src/core/transaction.c
index d7ecfdb446..09abe007fb 100644
--- a/src/core/transaction.c
+++ b/src/core/transaction.c
@@ -893,8 +893,8 @@ int transaction_add_job_and_dependencies(
/* If the link has no subject job, it's the anchor link. */
if (!by) {
LIST_PREPEND(JobDependency, subject, tr->anchor, l);
- if (!tr->anchor_job)
- tr->anchor_job = ret;
+ assert(!tr->anchor_job);
+ tr->anchor_job = ret;
}
if (is_new && !ignore_requirements) {
@@ -1077,7 +1077,7 @@ int transaction_add_isolate_jobs(Transaction *tr, Manager *m) {
if (hashmap_get(tr->jobs, u))
continue;
- r = transaction_add_job_and_dependencies(tr, JOB_STOP, u, NULL, true, false, false, false, false, NULL);
+ r = transaction_add_job_and_dependencies(tr, JOB_STOP, u, tr->anchor_job, true, false, false, false, false, NULL);
if (r < 0)
log_warning("Cannot add isolate job for unit %s, ignoring: %s", u->id, strerror(-r));
}