diff --git a/src/libostree/ostree-sysroot-deploy.c b/src/libostree/ostree-sysroot-deploy.c index 4e66296983..ef4f4156be 100644 --- a/src/libostree/ostree-sysroot-deploy.c +++ b/src/libostree/ostree-sysroot-deploy.c @@ -2247,7 +2247,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