summaryrefslogtreecommitdiff
path: root/unpack/restore_fstree.c
diff options
context:
space:
mode:
Diffstat (limited to 'unpack/restore_fstree.c')
-rw-r--r--unpack/restore_fstree.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/unpack/restore_fstree.c b/unpack/restore_fstree.c
index c06cd2b..c1320ea 100644
--- a/unpack/restore_fstree.c
+++ b/unpack/restore_fstree.c
@@ -1,10 +1,26 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
#include "rdsquashfs.h"
+static void print_name(tree_node_t *n)
+{
+ if (n->parent != NULL) {
+ print_name(n->parent);
+ fputc('/', stdout);
+ }
+
+ fputs(n->name, stdout);
+}
+
static int create_node(int dirfd, tree_node_t *n, unsqfs_info_t *info)
{
int fd;
+ if (!(info->flags & UNPACK_QUIET)) {
+ fputs("unpacking ", stdout);
+ print_name(n);
+ fputc('\n', stdout);
+ }
+
switch (n->mode & S_IFMT) {
case S_IFDIR:
if (mkdirat(dirfd, n->name, 0755) && errno != EEXIST) {