summaryrefslogtreecommitdiff
path: root/src/core/manager.c
diff options
context:
space:
mode:
authorMichal Schmidt <mschmidt@redhat.com>2012-04-20 00:33:26 +0200
committerMichal Schmidt <mschmidt@redhat.com>2012-04-20 17:12:28 +0200
commitb94fbd30781d7533492cec65bf7d86fa19a1a074 (patch)
treefc15708fd0255f4ed9422900ceebee64ebb462ea /src/core/manager.c
parent3c956cfee29fe2642fbe257f55adb3583a4af878 (diff)
transaction: maintain anchor_job
Track which job is the anchor in the transaction.
Diffstat (limited to 'src/core/manager.c')
-rw-r--r--src/core/manager.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/core/manager.c b/src/core/manager.c
index f070295d88..636aaa364b 100644
--- a/src/core/manager.c
+++ b/src/core/manager.c
@@ -656,7 +656,6 @@ int manager_startup(Manager *m, FILE *serialization, FDSet *fds) {
int manager_add_job(Manager *m, JobType type, Unit *unit, JobMode mode, bool override, DBusError *e, Job **_ret) {
int r;
- Job *ret;
Transaction *tr;
assert(m);
@@ -682,7 +681,7 @@ int manager_add_job(Manager *m, JobType type, Unit *unit, JobMode mode, bool ove
r = transaction_add_job_and_dependencies(tr, type, unit, NULL, true, override, false,
mode == JOB_IGNORE_DEPENDENCIES || mode == JOB_IGNORE_REQUIREMENTS,
- mode == JOB_IGNORE_DEPENDENCIES, e, &ret);
+ mode == JOB_IGNORE_DEPENDENCIES, e);
if (r < 0)
goto tr_abort;
@@ -696,10 +695,10 @@ int manager_add_job(Manager *m, JobType type, Unit *unit, JobMode mode, bool ove
if (r < 0)
goto tr_abort;
- log_debug("Enqueued job %s/%s as %u", unit->id, job_type_to_string(type), (unsigned) ret->id);
+ log_debug("Enqueued job %s/%s as %u", unit->id, job_type_to_string(type), (unsigned) tr->anchor_job->id);
if (_ret)
- *_ret = ret;
+ *_ret = tr->anchor_job;
transaction_free(tr);
return 0;