]> Git Repo - J-linux.git/commitdiff
libbpf: Return -ENODATA for missing btf section
authorChangbin Du <[email protected]>
Sat, 31 Dec 2022 15:14:36 +0000 (23:14 +0800)
committerAndrii Nakryiko <[email protected]>
Tue, 3 Jan 2023 22:27:42 +0000 (14:27 -0800)
As discussed before, return -ENODATA (No data available) would be more
meaningful than ENOENT (No such file or directory).

Suggested-by: Leo Yan <[email protected]>
Signed-off-by: Changbin Du <[email protected]>
Signed-off-by: Andrii Nakryiko <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
tools/lib/bpf/btf.c

index b0325000701889936d92388d1b0467217a6d94e8..64841117fbb209452b721e8c840c0797468f6d86 100644 (file)
@@ -1004,7 +1004,7 @@ static struct btf *btf_parse_elf(const char *path, struct btf *base_btf,
 
        if (!btf_data) {
                pr_warn("failed to find '%s' ELF section in %s\n", BTF_ELF_SEC, path);
-               err = -ENOENT;
+               err = -ENODATA;
                goto done;
        }
        btf = btf_new(btf_data->d_buf, btf_data->d_size, base_btf);
This page took 0.053587 seconds and 4 git commands to generate.