diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2023-09-08 18:49:54 +0200 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2023-09-08 18:49:54 +0200 |
commit | d5e2c6a3146c20354ab11f1dae48ab755996fa96 (patch) | |
tree | 02b766305a0636fb81dbb2f18320cae2fa0d828e /bin/sqfsdiff | |
parent | 4955f80f2fdc6ffeda77e0d569e9a010642772d2 (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/sqfsdiff')
-rw-r--r-- | bin/sqfsdiff/src/sqfsdiff.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/sqfsdiff/src/sqfsdiff.c b/bin/sqfsdiff/src/sqfsdiff.c index d789fe1..1bbf62c 100644 --- a/bin/sqfsdiff/src/sqfsdiff.c +++ b/bin/sqfsdiff/src/sqfsdiff.c @@ -22,9 +22,9 @@ static int open_sfqs(sqfs_state_t *state, const char *path) memset(state, 0, sizeof(*state)); - state->file = sqfs_open_file(path, SQFS_FILE_OPEN_READ_ONLY); + ret = sqfs_file_open(&state->file, path, SQFS_FILE_OPEN_READ_ONLY); if (state->file == NULL) { - perror(path); + sqfs_perror(path, "open", ret); return -1; } |