From da5656a8a696863e0d9941091c09c75b03a6070b Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Sat, 4 May 2019 23:30:58 +0200 Subject: Print out what we are doing on the way and options to keep quiet Signed-off-by: David Oberhollenzer --- unpack/restore_fstree.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'unpack/restore_fstree.c') 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) { -- cgit v1.2.3