btrfs-progs: receive: make option quiet work for chroot

With --chroot, the receive subcommand unconditionally sent a non-error
status message to stderr, e.g.:

$ btrfs --quiet receive --chroot /some/path
Chroot to /some/path

Signed-off-by: Sebastian Hamann <code@ares-macrotechnology.com>
This commit is contained in:
Sebastian Hamann 2024-09-28 13:04:31 +02:00 committed by David Sterba
parent 27506f8ac8
commit 863aa5df92
1 changed files with 2 additions and 1 deletions

View File

@ -1555,6 +1555,7 @@ static int do_receive(struct btrfs_receive *rctx, const char *tomnt,
error("failed to chdir to / after chroot: %m"); error("failed to chdir to / after chroot: %m");
goto out; goto out;
} }
if (bconf.verbose > BTRFS_BCONF_QUIET)
fprintf(stderr, "Chroot to %s\n", dest_dir_full_path); fprintf(stderr, "Chroot to %s\n", dest_dir_full_path);
rctx->root_path = strdup("/"); rctx->root_path = strdup("/");
rctx->dest_dir_path = rctx->root_path; rctx->dest_dir_path = rctx->root_path;