]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core/transaction: avoid unneeded gotos
authorMike Yuan <me@yhndnzj.com>
Sun, 8 Jan 2023 15:58:15 +0000 (23:58 +0800)
committerMike Yuan <me@yhndnzj.com>
Sun, 8 Jan 2023 16:09:10 +0000 (00:09 +0800)
src/core/transaction.c

index bafbb80b47d1d4edb7989940eb925e0c2a9d8495..fe8ba8d903eb9ecf16d42bb66863a3b9c2ecb1cd 100644 (file)
@@ -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) {