diff mbox series

[v3,bpf-next,3/4] libbpf: fix bpf_object__name() to actually return object name

Message ID 20191004224037.1625049-4-andriin@fb.com
State Accepted
Delegated to: BPF Maintainers
Headers show
Series Add new-style bpf_object__open APIs | expand

Commit Message

Andrii Nakryiko Oct. 4, 2019, 10:40 p.m. UTC
bpf_object__name() was returning file path, not name. Fix this.

Signed-off-by: Andrii Nakryiko <andriin@fb.com>
---
 tools/lib/bpf/libbpf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
index d471d33400ae..a02cdedc4e3f 100644
--- a/tools/lib/bpf/libbpf.c
+++ b/tools/lib/bpf/libbpf.c
@@ -4231,7 +4231,7 @@  bpf_object__next(struct bpf_object *prev)
 
 const char *bpf_object__name(const struct bpf_object *obj)
 {
-	return obj ? obj->path : ERR_PTR(-EINVAL);
+	return obj ? obj->name : ERR_PTR(-EINVAL);
 }
 
 unsigned int bpf_object__kversion(const struct bpf_object *obj)