Skip to content

Commit

Permalink
tools: bpftool: print nb of cmds to stdout (not stderr) for batch mode
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Quentin Monnet authored and Daniel Borkmann committed Oct 21, 2018
1 parent 882731e commit 06ee9da
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tools/bpf/bpftool/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 06ee9da

Please sign in to comment.