From 5d2ef3203874b2012f2865d3265287a3b69a27f1 Mon Sep 17 00:00:00 2001 From: Sebastian Hamann Date: Sat, 28 Sep 2024 13:04:31 +0200 Subject: [PATCH] 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 --- cmds/receive.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmds/receive.c b/cmds/receive.c index 4cc5b900..4ac76015 100644 --- a/cmds/receive.c +++ b/cmds/receive.c @@ -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 {