aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2022-08-20 11:42:08 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2022-08-20 14:45:16 +0200
commit581d9e9ae35d8ce6cbc2f53cdc1b05b962a0b590 (patch)
tree2879683a6e9fdfffd780d811032d322a7763dd28 /bin
parent26e3ec10db15409256bf773ad93c944156697e9e (diff)
Return an error number from sqfs_tree_find_hard_links
Instead of printing error messages to stderr, simply return an error number instead, that the caller then prints out using sqfs_perror. The underlying rbtree already uses sqfs error numbers, so little change is needed here. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'bin')
-rw-r--r--bin/sqfs2tar/write_tree.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/bin/sqfs2tar/write_tree.c b/bin/sqfs2tar/write_tree.c
index 1c19a5a..354ec21 100644
--- a/bin/sqfs2tar/write_tree.c
+++ b/bin/sqfs2tar/write_tree.c
@@ -182,8 +182,12 @@ int write_tree(const sqfs_tree_node_t *n)
int status = -1;
if (!no_links) {
- if (sqfs_tree_find_hard_links(n, &links))
+ int ret = sqfs_tree_find_hard_links(n, &links);
+ if (ret) {
+ sqfs_perror(NULL, "detecting hard links in "
+ "file system tree", ret);
return -1;
+ }
for (lnk = links; lnk != NULL; lnk = lnk->next) {
lnk->target = assemble_tar_path(lnk->target, false);