From: Quentin Monnet Date: Sat, 20 Oct 2018 22:01:49 +0000 (+0100) Subject: tools: bpftool: print nb of cmds to stdout (not stderr) for batch mode X-Git-Tag: v5.4-rc1~2403^2~32^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=06ee9da6a8b49e0e12b7a825dbe6ad243d5463e2;p=platform%2Fkernel%2Flinux-rpi.git tools: bpftool: print nb of cmds to stdout (not stderr) for batch mode When batch mode is used and all commands succeeds, bpftool prints the number of commands processed to stderr. There is no particular reason to use stderr for this, we could as well use stdout. It would avoid getting unnecessary output on stderr if the standard ouptut is redirected, for example. Reported-by: David Beckett Signed-off-by: Quentin Monnet Reviewed-by: Jakub Kicinski Signed-off-by: Daniel Borkmann --- diff --git a/tools/bpf/bpftool/main.c b/tools/bpf/bpftool/main.c index 828dde3..75a3296 100644 --- a/tools/bpf/bpftool/main.c +++ b/tools/bpf/bpftool/main.c @@ -321,7 +321,8 @@ static int do_batch(int argc, char **argv) p_err("reading batch file failed: %s", strerror(errno)); err = -1; } else { - p_info("processed %d commands", lines); + if (!json_output) + printf("processed %d commands\n", lines); err = 0; } err_close: