aboutsummaryrefslogtreecommitdiff
path: root/tar
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-11-06 10:44:26 +0100
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-11-06 11:10:58 +0100
commit3afffc2a59cfc3888a84b2b2305b5312393ff4e8 (patch)
tree029ac4c5f55e9e7149cd40d0f57c52efcd41608f /tar
parent9f1f3f959d3411c200afb5a1df4fffa9d87df616 (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 'tar')
-rw-r--r--tar/sqfs2tar.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/tar/sqfs2tar.c b/tar/sqfs2tar.c
index 1e05cd4..af116b8 100644
--- a/tar/sqfs2tar.c
+++ b/tar/sqfs2tar.c
@@ -174,7 +174,7 @@ static int terminate_archive(void)
memset(buffer, '\0', sizeof(buffer));
- return write_retry("adding archive terminator", STDOUT_FILENO,
+ return write_retry("adding archive terminator", stdout,
buffer, sizeof(buffer));
}
@@ -295,7 +295,7 @@ static int write_tree_dfs(const sqfs_tree_node_t *n)
}
target = S_ISLNK(sb.st_mode) ? n->inode->slink_target : NULL;
- ret = write_tar_header(STDOUT_FILENO, &sb, name, target, xattr,
+ ret = write_tar_header(stdout, &sb, name, target, xattr,
record_counter++);
while (xattr != NULL) {
@@ -313,13 +313,13 @@ static int write_tree_dfs(const sqfs_tree_node_t *n)
}
if (S_ISREG(sb.st_mode)) {
- if (sqfs_data_reader_dump(name, data, n->inode, STDOUT_FILENO,
+ if (sqfs_data_reader_dump(name, data, n->inode, stdout,
super.block_size, false)) {
free(name);
return -1;
}
- if (padd_file(STDOUT_FILENO, sb.st_size)) {
+ if (padd_file(stdout, sb.st_size)) {
free(name);
return -1;
}