]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
gpt-auto: use RET_GATHER at one more place
authorMike Yuan <me@yhndnzj.com>
Mon, 30 Sep 2024 19:21:53 +0000 (21:21 +0200)
committerMike Yuan <me@yhndnzj.com>
Mon, 14 Oct 2024 23:18:26 +0000 (01:18 +0200)
src/gpt-auto-generator/gpt-auto-generator.c

index d69a16af813454a86ebe09f56359e81b171f945a..6f0d7c877a0ec4180888a50599309ed076cdfb06 100644 (file)
@@ -955,7 +955,7 @@ static int parse_proc_cmdline_item(const char *key, const char *value, void *dat
 }
 
 static int run(const char *dest, const char *dest_early, const char *dest_late) {
-        int r, k;
+        int r;
 
         assert_se(arg_dest = dest_late);
 
@@ -975,12 +975,11 @@ static int run(const char *dest, const char *dest_early, const char *dest_late)
 
         if (arg_root_enabled)
                 r = add_root_mount();
+        else
+                r = 0;
 
-        if (!in_initrd()) {
-                k = add_mounts();
-                if (r >= 0)
-                        r = k;
-        }
+        if (!in_initrd())
+                RET_GATHER(r, add_mounts());
 
         return r;
 }