aboutsummaryrefslogtreecommitdiff
path: root/lib/sqfshelper
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-10-06 19:01:11 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-10-06 19:08:01 +0200
commit41ddda0c732d916a6962c54a3a974a8b753f194b (patch)
tree5ea74ef79c89d41e936dfbb8dc4d65ddbcde1a7d /lib/sqfshelper
parent19b7609586aac382f21bdc5c7369c56417775d6d (diff)
Improve error reporting for sqfs2tar, rdsquashfs, sqfsdiff
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/sqfshelper')
-rw-r--r--lib/sqfshelper/data_reader_dump.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/sqfshelper/data_reader_dump.c b/lib/sqfshelper/data_reader_dump.c
index 160f7f0..1a4ca65 100644
--- a/lib/sqfshelper/data_reader_dump.c
+++ b/lib/sqfshelper/data_reader_dump.c
@@ -16,7 +16,7 @@
#include <string.h>
#include <stdio.h>
-int sqfs_data_reader_dump(sqfs_data_reader_t *data,
+int sqfs_data_reader_dump(const char *name, sqfs_data_reader_t *data,
const sqfs_inode_generic_t *inode,
int outfd, size_t block_size, bool allow_sparse)
{
@@ -46,8 +46,7 @@ int sqfs_data_reader_dump(sqfs_data_reader_t *data,
} else {
err = sqfs_data_reader_get_block(data, inode, i, &blk);
if (err) {
- fprintf(stderr, "error reading "
- "data block: %d\n", err);
+ sqfs_perror(name, "reading data block", err);
return -1;
}
@@ -63,8 +62,9 @@ int sqfs_data_reader_dump(sqfs_data_reader_t *data,
}
if (filesz > 0) {
- if (sqfs_data_reader_get_fragment(data, inode, &blk)) {
- fputs("error reading fragment block", stderr);
+ err = sqfs_data_reader_get_fragment(data, inode, &blk);
+ if (err) {
+ sqfs_perror(name, "reading fragment block", err);
return -1;
}