diff options
| author | Changbin Du <[email protected]> | 2022-12-31 23:14:36 +0800 |
|---|---|---|
| committer | Andrii Nakryiko <[email protected]> | 2023-01-03 14:27:42 -0800 |
| commit | acd3b7768048fe338248cdf43ccfbf8c084a6bc1 (patch) | |
| tree | b154e5aa4a7dc70b2dab8fe2d0166f37e465b93e | |
| parent | 00883922ab404c0fc921709d8c2cec86f49c32f2 (diff) | |
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 <[email protected]>
Signed-off-by: Changbin Du <[email protected]>
Signed-off-by: Andrii Nakryiko <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
| -rw-r--r-- | tools/lib/bpf/btf.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/lib/bpf/btf.c b/tools/lib/bpf/btf.c index b03250007018..64841117fbb2 100644 --- a/tools/lib/bpf/btf.c +++ b/tools/lib/bpf/btf.c @@ -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); |