tools: bpftool: preserve JSON output on errors on batch file parsing
authorQuentin Monnet <quentin.monnet@netronome.com>
Thu, 15 Feb 2018 06:42:55 +0000 (22:42 -0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 15 Feb 2018 09:01:05 +0000 (10:01 +0100)
commit9be6d411b0c473d31f756993b8b41bb16b0679c1
tree90fef11760b8c33974b2027dd1e25ff5d264de52
parent52c84d36b7e2f8197a9a6174d6f901a7c7afb850
tools: bpftool: preserve JSON output on errors on batch file parsing

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>
tools/bpf/bpftool/main.c