diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-09-09 11:45:26 +0200 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-09-09 12:03:15 +0200 |
commit | 8ef9f10b20e313db5edd0b9c11ecdd8690812b8d (patch) | |
tree | 2695e7026197e016702abfa963f4034ca72e9362 /tar | |
parent | 526fd8b4969b2efe62e0fbc339a7b7dafefb7729 (diff) |
Remove ad-hoc image size accounting
Much simpler to just set the correct size in the end, before writing
the super block.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'tar')
-rw-r--r-- | tar/tar2sqfs.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tar/tar2sqfs.c b/tar/tar2sqfs.c index a27f72b..a6f5224 100644 --- a/tar/tar2sqfs.c +++ b/tar/tar2sqfs.c @@ -398,10 +398,8 @@ int main(int argc, char **argv) if (ret < 0) goto out_cmp; - if (ret > 0) { + if (ret > 0) super.flags |= SQFS_FLAG_COMPRESSOR_OPTIONS; - super.bytes_used += ret; - } data = data_writer_create(&super, cmp, outfile, devblksize, num_jobs); if (data == NULL) @@ -442,6 +440,8 @@ int main(int argc, char **argv) if (write_xattr(outfile, &fs, &super, cmp)) goto out; + super.bytes_used = outfile->get_size(outfile); + if (sqfs_super_write(&super, outfile)) goto out; |