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

transaction: introduce transaction_abort_and_free()

Will be used in following commits.
This commit is contained in:
David Tardon 2023-04-21 15:13:35 +02:00
parent 12da8805e7
commit 542fe40845
2 changed files with 11 additions and 0 deletions

View File

@ -1208,3 +1208,12 @@ Transaction *transaction_free(Transaction *tr) {
return mfree(tr);
}
Transaction *transaction_abort_and_free(Transaction *tr) {
if (!tr)
return NULL;
transaction_abort(tr);
return transaction_free(tr);
}

View File

@ -17,6 +17,8 @@ struct Transaction {
Transaction *transaction_new(bool irreversible);
Transaction *transaction_free(Transaction *tr);
Transaction *transaction_abort_and_free(Transaction *tr);
DEFINE_TRIVIAL_CLEANUP_FUNC(Transaction*, transaction_abort_and_free);
void transaction_add_propagate_reload_jobs(Transaction *tr, Unit *unit, Job *by, bool ignore_order, sd_bus_error *e);
int transaction_add_job_and_dependencies(