aboutsummaryrefslogtreecommitdiff
path: root/lib/sqfs/dir_reader.c
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2020-02-23 15:45:34 +0100
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2020-02-23 15:45:34 +0100
commitc9429aeece3b8642de637f7a21e68046bd690658 (patch)
tree50bac7c70a89010865a719b89bd44c63a78f1b26 /lib/sqfs/dir_reader.c
parentc2a093c9e9fb4889a11982797d75b8608c26da8f (diff)
Remove the sqfs_inode_copy function
With unified payload size counters, copying an inode is now trivial. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/sqfs/dir_reader.c')
-rw-r--r--lib/sqfs/dir_reader.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/sqfs/dir_reader.c b/lib/sqfs/dir_reader.c
index 39e3e57..4e2a5b8 100644
--- a/lib/sqfs/dir_reader.c
+++ b/lib/sqfs/dir_reader.c
@@ -222,12 +222,19 @@ int sqfs_dir_reader_find_by_path(sqfs_dir_reader_t *rd,
sqfs_inode_generic_t *inode;
sqfs_dir_entry_t *ent;
const char *ptr;
- int ret;
+ int ret = 0;
if (start == NULL) {
ret = sqfs_dir_reader_get_root_inode(rd, &inode);
} else {
- ret = sqfs_inode_copy(start, &inode);
+ inode = alloc_flex(sizeof(*inode), 1,
+ start->payload_bytes_used);
+ if (inode == NULL) {
+ ret = SQFS_ERROR_ALLOC;
+ } else {
+ memcpy(inode, start,
+ sizeof(*start) + start->payload_bytes_used);
+ }
}
if (ret)