]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
efi-loader: shorten the code a bit
authorMike Yuan <me@yhndnzj.com>
Thu, 26 Mar 2026 15:38:12 +0000 (16:38 +0100)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 25 Jul 2026 10:37:47 +0000 (19:37 +0900)
src/shared/efi-loader.c

index 20e4719bb067e07df84fc9c70f43145765c21434..73d6960297fcaf79766b7c2a3e0f3e0080ac5d01 100644 (file)
@@ -325,10 +325,10 @@ int efi_measured_os(int log_level) {
 
         bool b;
         r = proc_cmdline_get_bool("systemd.tpm2_measured_os", /* flags= */ 0, &b);
+        if (r > 0)
+                return (cached = b);
         if (r < 0)
                 log_debug_errno(r, "Failed to parse systemd.tpm2_measured_os= kernel command line argument, ignoring: %m");
-        else if (r > 0)
-                return (cached = b);
 
         /* If nothing is explicitly configured, just assume that if we booted with a measured UKI we also want a measured OS */
         return (cached = efi_measured_uki(log_level));