]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
repart: merge common conditions
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 26 Oct 2025 12:42:26 +0000 (21:42 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 2 Nov 2025 07:07:46 +0000 (16:07 +0900)
No functional change, just refactoring.

src/repart/repart.c

index 5ae14b32181ad30aa38d7e5127d0e8fb9f8e22b4..fbfa52c223adacae97b60aa06a267b62a2bcd3d6 100644 (file)
@@ -5580,13 +5580,15 @@ static int partition_format_verity_sig(Context *context, Partition *p) {
 
         verity_settings = lookup_verity_settings_by_uuid_pair(rp->current_uuid, hp->current_uuid);
 
-        if (!context->private_key && !verity_settings)
-                return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
-                                       "Verity signature partition signing requested but no private key provided (--private-key=).");
+        if (!verity_settings) {
+                if (!context->private_key)
+                        return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
+                                               "Verity signature partition signing requested but no private key provided (--private-key=).");
 
-        if (!context->certificate && !verity_settings)
-                return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
-                                       "Verity signature partition signing requested but no PEM certificate provided (--certificate=).");
+                if (!context->certificate)
+                        return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
+                                               "Verity signature partition signing requested but no PEM certificate provided (--certificate=).");
+        }
 
         (void) partition_hint(p, context->node, &hint);