summaryrefslogtreecommitdiff
path: root/manager.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-02-12 02:21:08 +0100
committerLennart Poettering <lennart@poettering.net>2010-02-12 02:21:08 +0100
commitc0dafa4853b52741e9a4845419c00611426cefd8 (patch)
tree4ea0b8825249b5e82766dd0423f99107dd011dbc /manager.c
parent0262225c0ca1e77517aacd40d093f9533de72027 (diff)
manager: properly return newly created job in transaction_add_job_and_dependencies()
Diffstat (limited to 'manager.c')
-rw-r--r--manager.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/manager.c b/manager.c
index 7a31c0c9d2..ace480c4dd 100644
--- a/manager.c
+++ b/manager.c
@@ -901,6 +901,9 @@ static int transaction_add_job_and_dependencies(Manager *m, JobType type, Unit *
/* JOB_VERIFY_STARTED, JOB_RELOAD require no dependency handling */
}
+ if (_ret)
+ *_ret = ret;
+
return 0;
fail:
@@ -918,7 +921,7 @@ int manager_add_job(Manager *m, JobType type, Unit *unit, JobMode mode, bool for
log_debug("Trying to enqueue job %s/%s", unit_id(unit), job_type_to_string(type));
- if ((r = transaction_add_job_and_dependencies(m, type, unit, NULL, true, force, &ret))) {
+ if ((r = transaction_add_job_and_dependencies(m, type, unit, NULL, true, force, &ret)) < 0) {
transaction_abort(m);
return r;
}
@@ -926,7 +929,7 @@ int manager_add_job(Manager *m, JobType type, Unit *unit, JobMode mode, bool for
if ((r = transaction_activate(m, mode)) < 0)
return r;
- log_debug("Enqueued job %s/%s", unit_id(unit), job_type_to_string(type));
+ log_debug("Enqueued job %s/%s as %u", unit_id(unit), job_type_to_string(type), (unsigned) ret->id);
if (_ret)
*_ret = ret;