[RFC,3/3] btrfs-progs: receive: make quiet really quiet
diff mbox series

Message ID 20191024062825.13097-4-anand.jain@oracle.com
State New
Headers show
Series
  • btrfs-progs: make quiet to overrule verbose
Related show

Commit Message

Anand Jain Oct. 24, 2019, 6:28 a.m. UTC
A message is still being printed even when the receive option --quiet
is specified, this patch fixes it.

before:
---- btrfs receive -q -f /tmp/t /btrfs1 -----
At snapshot ss3
---- btrfs receive -f /tmp/t /btrfs1 -----
At snapshot ss3

after:
---- btrfs receive -q -f /tmp/t /btrfs1 -----
---- btrfs receive -f /tmp/t /btrfs1 -----
At snapshot ss3

Signed-off-by: Anand Jain <anand.jain@oracle.com>

fstests doesn't use --quiet option, so all test cases should remain
unaffected with this change.
---
 cmds/receive.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Patch
diff mbox series

diff --git a/cmds/receive.c b/cmds/receive.c
index d8c934a7c57c..cc3df5c35821 100644
--- a/cmds/receive.c
+++ b/cmds/receive.c
@@ -269,7 +269,8 @@  static int process_snapshot(const char *path, const u8 *uuid, u64 ctransid,
 		goto out;
 	}
 
-	fprintf(stdout, "At snapshot %s\n", path);
+	if (g_verbose)
+		fprintf(stdout, "At snapshot %s\n", path);
 
 	memcpy(rctx->cur_subvol.received_uuid, uuid, BTRFS_UUID_SIZE);
 	rctx->cur_subvol.stransid = ctransid;