mirror of
https://github.com/netdata/libbpf.git
synced 2026-04-07 09:09:06 +08:00
libbpf: Return -ENODATA for missing btf section
As discussed before, return -ENODATA (No data available) would be more meaningful than ENOENT (No such file or directory). Suggested-by: Leo Yan <leo.yan@linaro.org> Signed-off-by: Changbin Du <changbin.du@gmail.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/bpf/20221231151436.6541-1-changbin.du@gmail.com
This commit is contained in:
committed by
Andrii Nakryiko
parent
f758104b07
commit
d572b6359e
@@ -1004,7 +1004,7 @@ static struct btf *btf_parse_elf(const char *path, struct btf *base_btf,
|
|||||||
|
|
||||||
if (!btf_data) {
|
if (!btf_data) {
|
||||||
pr_warn("failed to find '%s' ELF section in %s\n", BTF_ELF_SEC, path);
|
pr_warn("failed to find '%s' ELF section in %s\n", BTF_ELF_SEC, path);
|
||||||
err = -ENOENT;
|
err = -ENODATA;
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
btf = btf_new(btf_data->d_buf, btf_data->d_size, base_btf);
|
btf = btf_new(btf_data->d_buf, btf_data->d_size, base_btf);
|
||||||
|
|||||||
Reference in New Issue
Block a user