Skip to content

Commit

Permalink
image writer: Correctly handle mtime_nsec on big endiang
Browse files Browse the repository at this point in the history
i_mtime_nsec is 32bit, so use lcfs_u32_to_file, not lcfs_u64_to_file.
The later was breaking on big endian arches.

Signed-off-by: Alexander Larsson <[email protected]>
  • Loading branch information
alexlarsson committed Sep 19, 2023
1 parent bb6f577 commit dce33bb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libcomposefs/lcfs-writer-erofs.c
Original file line number Diff line number Diff line change
Expand Up @@ -881,7 +881,7 @@ static int write_erofs_inode_data(struct lcfs_ctx_s *ctx, struct lcfs_node_s *no
i.i_uid = lcfs_u32_to_file(node->inode.st_uid);
i.i_gid = lcfs_u32_to_file(node->inode.st_gid);
i.i_mtime = lcfs_u64_to_file(node->inode.st_mtim_sec);
i.i_mtime_nsec = lcfs_u64_to_file(node->inode.st_mtim_nsec);
i.i_mtime_nsec = lcfs_u32_to_file(node->inode.st_mtim_nsec);

if (type == S_IFDIR) {
if (node->erofs_n_blocks > 0) {
Expand Down

0 comments on commit dce33bb

Please sign in to comment.