diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2020-09-04 19:26:31 +0200 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2020-09-16 09:34:35 +0200 |
commit | 0a0cbefc6ebb6174aad3e6f0b8a6dea87aed49da (patch) | |
tree | 7b1a69382f7480e442620b6176c1673abcf81b3c /lib/tar/padd_file.c | |
parent | 4b994ac359757098ebc09263fff9e2290a58de71 (diff) |
Remodel file extraction tools to use libfstream
This commit rewrites the libtar write paths to use libfstream insead of
a FILE pointer. Also, the libcommon file extraction function is remodeled
to use libfstream.
In accordance, rdsquashfs, sqfs2tar and sqfsdiff have some minor
adjustments made to work with the ported libtar and libcommon.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/tar/padd_file.c')
-rw-r--r-- | lib/tar/padd_file.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/tar/padd_file.c b/lib/tar/padd_file.c index dd945a3..1173096 100644 --- a/lib/tar/padd_file.c +++ b/lib/tar/padd_file.c @@ -10,7 +10,7 @@ #include <stdlib.h> #include <stdio.h> -int padd_file(FILE *fp, sqfs_u64 size) +int padd_file(ostream_t *fp, sqfs_u64 size) { size_t padd_sz = size % TAR_RECORD_SIZE; int status = -1; @@ -25,10 +25,8 @@ int padd_file(FILE *fp, sqfs_u64 size) if (buffer == NULL) goto fail_errno; - if (write_retry("padding output file to block size", - fp, buffer, padd_sz)) { + if (ostream_append(fp, buffer, padd_sz)) goto out; - } status = 0; out: |