Skip to content

Commit

Permalink
tools: bpftool: preserve JSON output on errors on batch file parsing
Browse files Browse the repository at this point in the history
Before this patch, perror() function is used in some cases when bpftool
fails to parse its input file in batch mode. This function does not
integrate well with the rest of the output when JSON is used, so we
replace it by something that is compliant.

Most calls to perror() had already been replaced in a previous patch,
this one is a leftover.

Fixes: d319c8e101c5 ("tools: bpftool: preserve JSON output on errors on batch file parsing")
Signed-off-by: Quentin Monnet <quentin.monnet@netronome.com>
Acked-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 Feb 15, 2018
1 parent 52c84d3 commit 9be6d41
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/bpf/bpftool/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ static int do_batch(int argc, char **argv)
}

if (errno && errno != ENOENT) {
perror("reading batch file failed");
p_err("reading batch file failed: %s", strerror(errno));
err = -1;
} else {
p_info("processed %d lines", lines);
Expand Down

0 comments on commit 9be6d41

Please sign in to comment.