aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rw-r--r--bin/tar2sqfs/src/process_tarball.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/bin/tar2sqfs/src/process_tarball.c b/bin/tar2sqfs/src/process_tarball.c
index 639adf8..a2a4360 100644
--- a/bin/tar2sqfs/src/process_tarball.c
+++ b/bin/tar2sqfs/src/process_tarball.c
@@ -16,10 +16,10 @@ static int write_file(sqfs_writer_t *sqfs, dir_iterator_t *it,
if (no_tail_pack && ent->size > cfg.block_size)
flags |= SQFS_BLK_DONT_FRAGMENT;
- out = data_writer_ostream_create(ent->name, sqfs->data,
- &(n->data.file.inode), flags);
- if (out == NULL)
- return -1;
+ ret = sqfs_block_processor_create_ostream(&out, ent->name, sqfs->data,
+ &(n->data.file.inode), flags);
+ if (ret)
+ return ret;
ret = it->open_file_ro(it, &in);
if (ret != 0) {
@@ -31,7 +31,9 @@ static int write_file(sqfs_writer_t *sqfs, dir_iterator_t *it,
ret = sqfs_istream_splice(in, out, cfg.block_size);
} while (ret > 0);
- out->flush(out);
+ if (ret == 0)
+ ret = out->flush(out);
+
sqfs_drop(out);
sqfs_drop(in);
return ret;