summaryrefslogtreecommitdiff
path: root/tar/sqfs2tar.c
diff options
context:
space:
mode:
Diffstat (limited to 'tar/sqfs2tar.c')
-rw-r--r--tar/sqfs2tar.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/tar/sqfs2tar.c b/tar/sqfs2tar.c
index f7f7e71..1be1b7e 100644
--- a/tar/sqfs2tar.c
+++ b/tar/sqfs2tar.c
@@ -105,7 +105,8 @@ static int terminate_archive(void)
static int write_tree_dfs(fstree_t *fs, tree_node_t *n, data_reader_t *data)
{
- char *name;
+ char *name, *target;
+ struct stat sb;
int ret;
if (n->parent != NULL || !S_ISDIR(n->mode)) {
@@ -117,7 +118,10 @@ static int write_tree_dfs(fstree_t *fs, tree_node_t *n, data_reader_t *data)
assert(canonicalize_name(name) == 0);
- ret = write_tar_header(STDOUT_FILENO, fs, n, name);
+ fstree_node_stat(fs, n, &sb);
+
+ target = S_ISLNK(sb.st_mode) ? n->data.slink_target : NULL;
+ ret = write_tar_header(STDOUT_FILENO, &sb, name, target);
free(name);
if (ret < 0)