aboutsummaryrefslogtreecommitdiff
path: root/bin/sqfs2tar
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2023-09-08 18:49:54 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2023-09-08 18:49:54 +0200
commitd5e2c6a3146c20354ab11f1dae48ab755996fa96 (patch)
tree02b766305a0636fb81dbb2f18320cae2fa0d828e /bin/sqfs2tar
parent4955f80f2fdc6ffeda77e0d569e9a010642772d2 (diff)
libsqfs: bring sqfs_file_t in line with stream API
Rename the open function to sqfs_file_open, use an argument for the return pointer and pass back and error number on failure. Also add an inermediate function to open an sqfs_file_t using a handle, similar to the stream API. The get_file_size function is moved to the native wrappers and some of the implementation is cleaned up a little. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'bin/sqfs2tar')
-rw-r--r--bin/sqfs2tar/src/sqfs2tar.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/bin/sqfs2tar/src/sqfs2tar.c b/bin/sqfs2tar/src/sqfs2tar.c
index 714f6db..e21cd7a 100644
--- a/bin/sqfs2tar/src/sqfs2tar.c
+++ b/bin/sqfs2tar/src/sqfs2tar.c
@@ -139,9 +139,9 @@ int main(int argc, char **argv)
goto out;
}
- file = sqfs_open_file(filename, SQFS_FILE_OPEN_READ_ONLY);
- if (file == NULL) {
- perror(filename);
+ ret = sqfs_file_open(&file, filename, SQFS_FILE_OPEN_READ_ONLY);
+ if (ret) {
+ sqfs_perror(filename, "open", ret);
goto out;
}