diff options
| author | Jakub Kicinski <[email protected]> | 2019-08-07 00:19:23 +0000 |
|---|---|---|
| committer | Daniel Borkmann <[email protected]> | 2019-08-09 15:38:53 +0000 |
| commit | 3c7be384fe6da0d7b1d6fc0ad6b4a33edb73aad5 (patch) | |
| tree | ff6a09b0cb3b5fbe8a05bd28c6f86fb505a79f7b /tools/bpf/bpftool/common.c | |
| parent | tools: bpftool: fix error message (prog -> object) (diff) | |
| download | kernel-3c7be384fe6da0d7b1d6fc0ad6b4a33edb73aad5.tar.gz kernel-3c7be384fe6da0d7b1d6fc0ad6b4a33edb73aad5.zip | |
tools: bpftool: add error message on pin failure
No error message is currently printed if the pin syscall
itself fails. It got lost in the loadall refactoring.
Fixes: 77380998d91d ("bpftool: add loadall command")
Reported-by: Andy Lutomirski <[email protected]>
Signed-off-by: Jakub Kicinski <[email protected]>
Reviewed-by: Quentin Monnet <[email protected]>
Acked-by: Andrii Nakryiko <[email protected]>
Signed-off-by: Daniel Borkmann <[email protected]>
Diffstat (limited to 'tools/bpf/bpftool/common.c')
| -rw-r--r-- | tools/bpf/bpftool/common.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/bpf/bpftool/common.c b/tools/bpf/bpftool/common.c index c52a6ffb8949..6a71324be628 100644 --- a/tools/bpf/bpftool/common.c +++ b/tools/bpf/bpftool/common.c @@ -204,7 +204,11 @@ int do_pin_fd(int fd, const char *name) if (err) return err; - return bpf_obj_pin(fd, name); + err = bpf_obj_pin(fd, name); + if (err) + p_err("can't pin the object (%s): %s", name, strerror(errno)); + + return err; } int do_pin_any(int argc, char **argv, int (*get_fd_by_id)(__u32)) |
