Skip to content

Commit

Permalink
sysroot: Fix _ostree_sysroot_ensure_writable
Browse files Browse the repository at this point in the history
  • Loading branch information
ruihe774 committed Dec 22, 2024
1 parent e808a69 commit b3851de
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/libostree/ostree-sysroot.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit b3851de

Please sign in to comment.