]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
cryptsetup-generator: parse all cmdline devices too
authorDavid Tardon <dtardon@redhat.com>
Thu, 30 May 2024 11:32:20 +0000 (13:32 +0200)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 12 Jun 2024 09:46:39 +0000 (18:46 +0900)
src/cryptsetup/cryptsetup-generator.c

index 6016e7580b80260444e20fd99cb3c60a4479c570..56350b9b1286b9c160233b78890d104b939d0537 100644 (file)
@@ -884,7 +884,7 @@ static int add_crypttab_devices(void) {
 }
 
 static int add_proc_cmdline_devices(void) {
-        int r;
+        int r, ret = 0;
         crypto_device *d;
 
         HASHMAP_FOREACH(d, arg_disks) {
@@ -910,11 +910,10 @@ static int add_proc_cmdline_devices(void) {
                                 d->headerdev,
                                 d->options ?: arg_default_options,
                                 "/proc/cmdline");
-                if (r < 0)
-                        return r;
+                RET_GATHER(ret, r);
         }
 
-        return 0;
+        return ret;
 }
 
 DEFINE_PRIVATE_HASH_OPS_WITH_VALUE_DESTRUCTOR(crypt_device_hash_ops, char, string_hash_func, string_compare_func,