aboutsummaryrefslogtreecommitdiff
path: root/bin/sqfs2tar/src
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2023-09-18 23:25:32 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2023-09-19 13:25:32 +0200
commit6a5d2dc7795029acf38862ecaefebc4015400045 (patch)
tree2173162d1eb84012c47e9048bdb74b94cc2b8063 /bin/sqfs2tar/src
parentbfd932fb3470fa7250359da6ed5641182a10077c (diff)
libtar: accept an sqfs_dir_entry_t instead of a struct stat
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'bin/sqfs2tar/src')
-rw-r--r--bin/sqfs2tar/src/sqfs2tar.c23
1 files changed, 3 insertions, 20 deletions
diff --git a/bin/sqfs2tar/src/sqfs2tar.c b/bin/sqfs2tar/src/sqfs2tar.c
index 786182c..0f83abf 100644
--- a/bin/sqfs2tar/src/sqfs2tar.c
+++ b/bin/sqfs2tar/src/sqfs2tar.c
@@ -44,7 +44,6 @@ static int write_entry(sqfs_dir_iterator_t *it, const sqfs_dir_entry_t *ent)
static unsigned int record_counter;
sqfs_xattr_t *xattr = NULL;
char *target = NULL;
- struct stat sb;
int ret;
if (S_ISLNK(ent->mode) ||
@@ -64,25 +63,9 @@ static int write_entry(sqfs_dir_iterator_t *it, const sqfs_dir_entry_t *ent)
return ret;
}
- memset(&sb, 0, sizeof(sb));
- sb.st_mode = ent->mode;
- sb.st_uid = ent->uid;
- sb.st_gid = ent->gid;
- sb.st_mtime = ent->mtime;
- sb.st_rdev = ent->rdev;
- sb.st_size = ent->size;
-
- if (ent->flags & SQFS_DIR_ENTRY_FLAG_HARD_LINK) {
- ret = write_hard_link(out_file, &sb, ent->name, target,
- record_counter++);
- if (ret)
- sqfs_perror(ent->name, "writing tar hard link", ret);
- } else {
- ret = write_tar_header(out_file, &sb, ent->name, target,
- xattr, record_counter++);
- if (ret)
- sqfs_perror(ent->name, "writing tar header", ret);
- }
+ ret = write_tar_header(out_file, ent, target, xattr, record_counter++);
+ if (ret)
+ sqfs_perror(ent->name, "writing tar header", ret);
if (S_ISREG(ent->mode) && ret == 0)
ret = write_file_data(it, ent);