Skip to content

Commit

Permalink
composeutil: Add error prefixing to legacy mkdev path
Browse files Browse the repository at this point in the history
Had to track down via strace that it was this that was failing
in my toolbox container.

Really need to merge the unified-core-only PR.

Closes: #1845
Approved by: jlebon
  • Loading branch information
cgwalters authored and rh-atomic-bot committed May 27, 2019
1 parent 7dcfb2d commit bee8ba4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/app/rpmostree-composeutil.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ gboolean
rpmostree_composeutil_legacy_prep_dev (int rootfs_dfd,
GError **error)
{
GLNX_AUTO_PREFIX_ERROR ("Preparing dev (legacy)", error);

glnx_autofd int src_fd = openat (AT_FDCWD, "/dev", O_RDONLY | O_NONBLOCK | O_DIRECTORY | O_CLOEXEC | O_NOCTTY);
if (src_fd == -1)
Expand All @@ -129,9 +130,9 @@ rpmostree_composeutil_legacy_prep_dev (int rootfs_dfd,
continue;

if (mknodat (dest_fd, nodename, stbuf.st_mode, stbuf.st_rdev) != 0)
return glnx_throw_errno (error);
return glnx_throw_errno_prefix (error, "mknodat");
if (fchmodat (dest_fd, nodename, stbuf.st_mode, 0) != 0)
return glnx_throw_errno (error);
return glnx_throw_errno_prefix (error, "fchmodat");
}

{ GLNX_AUTO_PREFIX_ERROR ("Testing /dev/null in target root (is nodev set?)", error);
Expand Down

0 comments on commit bee8ba4

Please sign in to comment.