From 65a2493e3876f7a040c694e1004c5c765fd29c27 Mon Sep 17 00:00:00 2001 From: Mike Yuan Date: Sun, 8 Jan 2023 23:58:15 +0800 Subject: [PATCH] core/transaction: avoid unneeded gotos --- src/core/transaction.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/core/transaction.c b/src/core/transaction.c index bafbb80b47d..fe8ba8d903e 100644 --- a/src/core/transaction.c +++ b/src/core/transaction.c @@ -1000,7 +1000,7 @@ int transaction_add_job_and_dependencies( r = transaction_add_job_and_dependencies(tr, JOB_START, dep, ret, true, false, false, ignore_order, e); if (r < 0) { if (r != -EBADR) /* job type not applicable */ - goto fail; + return r; sd_bus_error_free(e); } @@ -1022,7 +1022,7 @@ int transaction_add_job_and_dependencies( r = transaction_add_job_and_dependencies(tr, JOB_VERIFY_ACTIVE, dep, ret, true, false, false, ignore_order, e); if (r < 0) { if (r != -EBADR) /* job type not applicable */ - goto fail; + return r; sd_bus_error_free(e); } @@ -1032,7 +1032,7 @@ int transaction_add_job_and_dependencies( r = transaction_add_job_and_dependencies(tr, JOB_STOP, dep, ret, true, true, false, ignore_order, e); if (r < 0) { if (r != -EBADR) /* job type not applicable */ - goto fail; + return r; sd_bus_error_free(e); } @@ -1073,7 +1073,7 @@ int transaction_add_job_and_dependencies( r = transaction_add_job_and_dependencies(tr, nt, dep, ret, true, false, false, ignore_order, e); if (r < 0) { if (r != -EBADR) /* job type not applicable */ - goto fail; + return r; sd_bus_error_free(e); } @@ -1087,9 +1087,6 @@ int transaction_add_job_and_dependencies( } return 0; - -fail: - return r; } int transaction_add_isolate_jobs(Transaction *tr, Manager *m) { -- 2.47.3