]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
veritysetup-generator: exit on first error
authorLennart Poettering <lennart@poettering.net>
Wed, 19 Mar 2025 09:05:25 +0000 (10:05 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 19 Mar 2025 15:32:02 +0000 (16:32 +0100)
src/veritysetup/veritysetup-generator.c

index 520cf097e54329f873a1d0bf60d7d2f71d4079f0..cc489b1b6517d0189d401b35b3fbebc33dd5a197 100644 (file)
@@ -65,14 +65,11 @@ static int create_special_device(
 
         /* if one of them is missing however, the data is simply incomplete and this is an error */
         if (!roothash)
-                log_error("Verity information for %s incomplete, root hash unspecified.", name);
+                return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "Verity information for %s incomplete, root hash unspecified.", name);
         if (!data_what)
-                log_error("Verity information for %s incomplete, data device unspecified.", name);
+                return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "Verity information for %s incomplete, data device unspecified.", name);
         if (!hash_what)
-                log_error("Verity information for %s incomplete, hash device unspecified.", name);
-
-        if (!roothash || !data_what || !hash_what)
-                return -EINVAL;
+                return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "Verity information for %s incomplete, hash device unspecified.", name);
 
         _cleanup_free_ char *service = NULL;
         r = unit_name_build("systemd-veritysetup", name, ".service", &service);