]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
bootctl: rearrange if branches in vl_method_install() 40622/head
authorLennart Poettering <lennart@amutable.com>
Tue, 10 Feb 2026 10:47:33 +0000 (11:47 +0100)
committerLennart Poettering <lennart@amutable.com>
Tue, 10 Feb 2026 10:56:26 +0000 (11:56 +0100)
src/bootctl/bootctl-install.c

index a25557895bc00430c4af9f16568544c623ee0921..50ab7b602c4e265e3ab01c94ca91b160a2685e34 100644 (file)
@@ -2051,15 +2051,11 @@ int vl_method_install(
                         if (empty_or_root(p.context.root))
                                 p.context.root = mfree(p.context.root);
                 }
-        }
-
-        if (p.context.root_fd < 0 && p.context.root) {
+        } else if (p.context.root) {
                 p.context.root_fd = open(p.context.root, O_RDONLY|O_CLOEXEC|O_DIRECTORY);
                 if (p.context.root_fd < 0)
                         return log_debug_errno(errno, "Failed to open '%s': %m", p.context.root);
-        }
-
-        if (p.context.root_fd < 0)
+        } else
                 p.context.root_fd = XAT_FDROOT;
 
         if (p.context.entry_token_type < 0)