sysroot: Fix _ostree_sysroot_ensure_writable

This commit is contained in:
Misaki Kasumi 2024-12-22 16:26:27 +08:00
parent e808a69067
commit b3851dec99

View File

@ -586,8 +586,11 @@ _ostree_sysroot_ensure_writable (OstreeSysroot *self, GError **error)
if (!ensure_sysroot_fd (self, error))
return FALSE;
if (!_ostree_sysroot_ensure_boot_fd (self, error))
return FALSE;
glnx_autofd int old_sysroot_fd = g_steal_fd (&self->sysroot_fd);
if ((self->sysroot_fd = (int)syscall (SYS_open_tree, old_sysroot_fd, "sysroot", 1 /* OPEN_TREE_CLONE */ | O_CLOEXEC)) < 0)
return glnx_throw_errno_prefix (error, "open_tree");
if ((self->boot_fd = (int)syscall (SYS_open_tree, old_sysroot_fd, "boot", 1 /* OPEN_TREE_CLONE */ | O_CLOEXEC)) < 0)
return glnx_throw_errno_prefix (error, "open_tree");
/* Switch back */
if (in_root)