diff options
Diffstat (limited to 'bin/sqfs2tar/src')
-rw-r--r-- | bin/sqfs2tar/src/sqfs2tar.c | 11 | ||||
-rw-r--r-- | bin/sqfs2tar/src/write_tree.c | 11 |
2 files changed, 16 insertions, 6 deletions
diff --git a/bin/sqfs2tar/src/sqfs2tar.c b/bin/sqfs2tar/src/sqfs2tar.c index e90aa56..714f6db 100644 --- a/bin/sqfs2tar/src/sqfs2tar.c +++ b/bin/sqfs2tar/src/sqfs2tar.c @@ -117,9 +117,9 @@ int main(int argc, char **argv) process_args(argc, argv); - out_file = ostream_open_stdout(); - if (out_file == NULL) { - perror("changing stdout to binary mode"); + ret = ostream_open_stdout(&out_file); + if (ret) { + sqfs_perror("stdout", "creating stream wrapper", ret); goto out; } @@ -253,8 +253,11 @@ int main(int argc, char **argv) if (terminate_archive()) goto out; - if (out_file->flush(out_file)) + ret = out_file->flush(out_file); + if (ret) { + sqfs_perror(out_file->get_filename(out_file), NULL, ret); goto out; + } status = EXIT_SUCCESS; out: diff --git a/bin/sqfs2tar/src/write_tree.c b/bin/sqfs2tar/src/write_tree.c index e578a9f..dc3ac72 100644 --- a/bin/sqfs2tar/src/write_tree.c +++ b/bin/sqfs2tar/src/write_tree.c @@ -119,6 +119,8 @@ static int write_tree_dfs(const sqfs_tree_node_t *n) if (lnk != NULL) { ret = write_hard_link(out_file, &sb, name, lnk->target, record_counter++); + if (ret != 0) + sqfs_perror(name, "writing hard link", ret); sqfs_free(name); return ret; } @@ -143,10 +145,13 @@ static int write_tree_dfs(const sqfs_tree_node_t *n) record_counter++); sqfs_xattr_list_free(xattr); - if (ret > 0) + if (ret == SQFS_ERROR_UNSUPPORTED) { + fprintf(stderr, "WARNING: %s: unsupported file type\n", name); goto out_skip; + } if (ret < 0) { + sqfs_perror(name, "writing tar header", ret); sqfs_free(name); return -1; } @@ -158,7 +163,9 @@ static int write_tree_dfs(const sqfs_tree_node_t *n) return -1; } - if (padd_file(out_file, sb.st_size)) { + ret = padd_file(out_file, sb.st_size); + if (ret) { + sqfs_perror(name, NULL, ret); sqfs_free(name); return -1; } |