1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-23 21:35:11 +03:00

manager: use _cleanup_ in manager_propagate_reload()

This commit is contained in:
David Tardon 2023-04-21 15:15:38 +02:00
parent c7e3eb5dd5
commit 32620826cf

View File

@ -2112,7 +2112,7 @@ int manager_add_job_by_name_and_warn(Manager *m, JobType type, const char *name,
int manager_propagate_reload(Manager *m, Unit *unit, JobMode mode, sd_bus_error *e) {
int r;
Transaction *tr;
_cleanup_(transaction_abort_and_freep) Transaction *tr = NULL;
assert(m);
assert(unit);
@ -2126,22 +2126,17 @@ int manager_propagate_reload(Manager *m, Unit *unit, JobMode mode, sd_bus_error
/* We need an anchor job */
r = transaction_add_job_and_dependencies(tr, JOB_NOP, unit, NULL, false, false, true, true, e);
if (r < 0)
goto tr_abort;
return r;
/* Failure in adding individual dependencies is ignored, so this always succeeds. */
transaction_add_propagate_reload_jobs(tr, unit, tr->anchor_job, mode == JOB_IGNORE_DEPENDENCIES, e);
r = transaction_activate(tr, m, mode, NULL, e);
if (r < 0)
goto tr_abort;
transaction_free(tr);
return 0;
tr_abort:
transaction_abort(tr);
transaction_free(tr);
return r;
tr = transaction_free(tr);
return 0;
}
Job *manager_get_job(Manager *m, uint32_t id) {