diff options
author | Jakub Kicinski <jakub.kicinski@netronome.com> | 2018-06-20 21:42:45 +0300 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2018-06-22 00:07:12 +0300 |
commit | 957f9a13df6c70aac31a1dade5e417c286d6d258 (patch) | |
tree | 407c66bf0df05519bb6f4daaf1a68bd6335e62ab /tools/bpf/bpftool | |
parent | 3739a21e0ef6ac06f46bd38e81daa95e8cb462bc (diff) |
tools: bpftool: remove duplicated error message on prog load
do_pin_fd() will already print out an error message if something
goes wrong. Printing another error is unnecessary and will break
JSON output, since error messages are full objects:
$ bpftool -jp prog load tracex1_kern.o /sys/fs/bpf/a
{
"error": "can't pin the object (/sys/fs/bpf/a): File exists"
},{
"error": "failed to pin program"
}
Fixes: 49a086c201a9 ("bpftool: implement prog load command")
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Quentin Monnet <quentin.monnet@netronome.com>
Acked-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'tools/bpf/bpftool')
-rw-r--r-- | tools/bpf/bpftool/prog.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/tools/bpf/bpftool/prog.c b/tools/bpf/bpftool/prog.c index 05f42a46d6ed..12b694fe0404 100644 --- a/tools/bpf/bpftool/prog.c +++ b/tools/bpf/bpftool/prog.c @@ -694,10 +694,8 @@ static int do_load(int argc, char **argv) return -1; } - if (do_pin_fd(prog_fd, argv[1])) { - p_err("failed to pin program"); + if (do_pin_fd(prog_fd, argv[1])) return -1; - } if (json_output) jsonw_null(json_wtr); |