1
0
Fork 0

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 <david.beckett@netronome.com>
Signed-off-by: Quentin Monnet <quentin.monnet@netronome.com>
Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
hifive-unleashed-5.1
Quentin Monnet 2018-10-20 23:01:49 +01:00 committed by Daniel Borkmann
parent 882731e06c
commit 06ee9da6a8
1 changed files with 2 additions and 1 deletions

View File

@ -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: