summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorQuentin Monnet <quentin.monnet@netronome.com>2018-02-15 07:42:55 +0100
committerDaniel Borkmann <daniel@iogearbox.net>2018-02-15 10:01:05 +0100
commit9be6d411b0c473d31f756993b8b41bb16b0679c1 (patch)
tree90fef11760b8c33974b2027dd1e25ff5d264de52 /tools
parenttools: bpftool: preserve JSON for batch mode when dumping insns to file (diff)
downloadlinux-9be6d411b0c473d31f756993b8b41bb16b0679c1.tar.xz
linux-9be6d411b0c473d31f756993b8b41bb16b0679c1.zip
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>
Diffstat (limited to 'tools')
-rw-r--r--tools/bpf/bpftool/main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/bpf/bpftool/main.c b/tools/bpf/bpftool/main.c
index 3a0396d87c42..185acfa229b5 100644
--- a/tools/bpf/bpftool/main.c
+++ b/tools/bpf/bpftool/main.c
@@ -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);