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 Qu Wenruo
parent c2c922f473
commit 5d2ef32038
1 changed files with 2 additions and 1 deletions

View File

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