transaction: introduce transaction_abort_and_free()
Will be used in following commits.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user