Commit acd3b776 authored by Changbin Du's avatar Changbin Du Committed by Andrii Nakryiko

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: default avatarLeo Yan <leo.yan@linaro.org>
Signed-off-by: default avatarChangbin Du <changbin.du@gmail.com>
Signed-off-by: default avatarAndrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20221231151436.6541-1-changbin.du@gmail.com
parent 00883922
...@@ -1004,7 +1004,7 @@ static struct btf *btf_parse_elf(const char *path, struct btf *base_btf, ...@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment