aboutsummaryrefslogtreecommitdiff
path: root/bin/tar2sqfs/src
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2023-06-16 19:46:46 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2023-06-17 15:27:19 +0200
commit0abe1816da2706f87432c4e04918ad0eec902479 (patch)
treebae50f863a3784ddd709911cdabac06c5e759679 /bin/tar2sqfs/src
parent230453fc840c112bbe2c18708338fd897f1174ec (diff)
Move data writer ostream into libsquashfs
It is mainly a very thin wrapper on top of the block processor so far. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'bin/tar2sqfs/src')
-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;