diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-09-08 14:53:30 +0200 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-09-08 14:53:30 +0200 |
commit | 3a851dfe87c88ac1d4dddc2a26cc48b037f852f9 (patch) | |
tree | a8a8f34291aa58b25737088d247a91a7f60b4fec /lib/sqfshelper/deserialize_fstree.c | |
parent | 60064dd0412a149fe00cfc4e2f2361c22656db57 (diff) |
Replace direct file I/O with abstraction layer
This should make it easier to use libsquashfs with custom setups that
embedd a squashfs image inside something else. Also, it should make
it easier to port to non unix-like platforms.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/sqfshelper/deserialize_fstree.c')
-rw-r--r-- | lib/sqfshelper/deserialize_fstree.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/sqfshelper/deserialize_fstree.c b/lib/sqfshelper/deserialize_fstree.c index 1953f9b..37861e6 100644 --- a/lib/sqfshelper/deserialize_fstree.c +++ b/lib/sqfshelper/deserialize_fstree.c @@ -203,7 +203,7 @@ static int fill_dir(sqfs_meta_reader_t *ir, sqfs_meta_reader_t *dr, } int deserialize_fstree(fstree_t *out, sqfs_super_t *super, - sqfs_compressor_t *cmp, int fd, int flags) + sqfs_compressor_t *cmp, sqfs_file_t *file, int flags) { uint64_t block_start, limit; sqfs_meta_reader_t *ir, *dr; @@ -213,7 +213,7 @@ int deserialize_fstree(fstree_t *out, sqfs_super_t *super, int status = -1; size_t offset; - ir = sqfs_meta_reader_create(fd, cmp, super->inode_table_start, + ir = sqfs_meta_reader_create(file, cmp, super->inode_table_start, super->directory_table_start); if (ir == NULL) return -1; @@ -224,7 +224,7 @@ int deserialize_fstree(fstree_t *out, sqfs_super_t *super, if (super->fragment_table_start < limit) limit = super->fragment_table_start; - dr = sqfs_meta_reader_create(fd, cmp, super->directory_table_start, + dr = sqfs_meta_reader_create(file, cmp, super->directory_table_start, limit); if (dr == NULL) goto out_ir; @@ -233,10 +233,10 @@ int deserialize_fstree(fstree_t *out, sqfs_super_t *super, if (idtbl == NULL) goto out_dr; - if (sqfs_id_table_read(idtbl, fd, super, cmp)) + if (sqfs_id_table_read(idtbl, file, super, cmp)) goto out_id; - xr = sqfs_xattr_reader_create(fd, super, cmp); + xr = sqfs_xattr_reader_create(file, super, cmp); if (xr == NULL) goto out_id; |