diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-11-06 10:44:26 +0100 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-11-06 11:10:58 +0100 |
commit | 3afffc2a59cfc3888a84b2b2305b5312393ff4e8 (patch) | |
tree | 029ac4c5f55e9e7149cd40d0f57c52efcd41608f /lib/tar/padd_file.c | |
parent | 9f1f3f959d3411c200afb5a1df4fffa9d87df616 (diff) |
Remove raw file descriptors from unpack write paths
Instead, use stdio FILE pointers. On POSIX systems, use fileno to get
the file descriptor and hopefully create sparase files.
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 | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/tar/padd_file.c b/lib/tar/padd_file.c index f58cfbf..dd945a3 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(int outfd, sqfs_u64 size) +int padd_file(FILE *fp, sqfs_u64 size) { size_t padd_sz = size % TAR_RECORD_SIZE; int status = -1; @@ -26,7 +26,7 @@ int padd_file(int outfd, sqfs_u64 size) goto fail_errno; if (write_retry("padding output file to block size", - outfd, buffer, padd_sz)) { + fp, buffer, padd_sz)) { goto out; } |