From 51480b56c802ead2cd81844df79580df9c719d8f Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 10 Feb 2026 11:47:33 +0100 Subject: [PATCH] bootctl: rearrange if branches in vl_method_install() --- src/bootctl/bootctl-install.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/bootctl/bootctl-install.c b/src/bootctl/bootctl-install.c index a25557895bc..50ab7b602c4 100644 --- a/src/bootctl/bootctl-install.c +++ b/src/bootctl/bootctl-install.c @@ -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) -- 2.47.3