From: Mike Yuan Date: Sun, 8 Jan 2023 15:58:15 +0000 (+0800) Subject: core/transaction: avoid unneeded gotos X-Git-Tag: v253-rc1~64^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=65a2493e3876f7a040c694e1004c5c765fd29c27;p=thirdparty%2Fsystemd.git core/transaction: avoid unneeded gotos --- 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) {