From 082605e7edc4d4d8c054f1f6ff931c4b8543ca96 Mon Sep 17 00:00:00 2001 From: Misaki Kasumi Date: Tue, 24 Dec 2024 00:43:41 +0800 Subject: [PATCH] sysroot-deploy: Fix swap_bootloader --- src/libostree/ostree-sysroot-deploy.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/libostree/ostree-sysroot-deploy.c b/src/libostree/ostree-sysroot-deploy.c index d026690b7b..984dec5363 100644 --- a/src/libostree/ostree-sysroot-deploy.c +++ b/src/libostree/ostree-sysroot-deploy.c @@ -2260,7 +2260,10 @@ swap_bootloader (OstreeSysroot *sysroot, OstreeBootloader *bootloader, int curre * for whatever reason, and we wouldn't want to confuse the * admin by going back to the previous session. */ - if (fsync (sysroot->boot_fd) != 0) + glnx_autofd int boot_dir_fd = -1; + if (!glnx_opendirat (sysroot->boot_fd, ".", TRUE, &boot_dir_fd, error)) + return FALSE; + if (fsync (boot_dir_fd) != 0) return glnx_throw_errno_prefix (error, "fsync(boot)"); /* TODO: In the future also execute this automatically via a systemd unit