From 74b739ac61fb49f93a8ce814a37026bf1d405466 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Wed, 4 Mar 2020 01:09:18 +0100 Subject: Cleanup: match xattr reader API closer to id table API Instead of creating everything in the "create" function, cleanup and create/initialize stuff in a "load" function. This allows the xattr reader to be reset/re-used and adds the benefit of not having to lug around references to the super block, compressor and file (altough the later two are hidden inside the meta reader). Signed-off-by: David Oberhollenzer --- unpack/rdsquashfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'unpack') diff --git a/unpack/rdsquashfs.c b/unpack/rdsquashfs.c index 99e51fb..7b3bddf 100644 --- a/unpack/rdsquashfs.c +++ b/unpack/rdsquashfs.c @@ -74,14 +74,14 @@ int main(int argc, char **argv) } if (!(super.flags & SQFS_FLAG_NO_XATTRS)) { - xattr = sqfs_xattr_reader_create(file, &super, cmp); + xattr = sqfs_xattr_reader_create(0); if (xattr == NULL) { sqfs_perror(opt.image_name, "creating xattr reader", SQFS_ERROR_ALLOC); goto out_cmp; } - ret = sqfs_xattr_reader_load_locations(xattr); + ret = sqfs_xattr_reader_load(xattr, &super, file, cmp); if (ret) { sqfs_perror(opt.image_name, "loading xattr table", ret); -- cgit v1.2.3