From 41ddda0c732d916a6962c54a3a974a8b753f194b Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Sun, 6 Oct 2019 19:01:11 +0200 Subject: Improve error reporting for sqfs2tar, rdsquashfs, sqfsdiff Signed-off-by: David Oberhollenzer --- lib/sqfshelper/data_reader_dump.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lib/sqfshelper') 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 #include -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; } -- cgit v1.2.3