lkml.org 
[lkml]   [2022]   [Dec]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] libbpf: Return -ENODATA for missing btf section
Date
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>
Cc: Andrii Nakryiko <andrii.nakryiko@gmail.com>
Signed-off-by: Changbin Du <changbin.du@gmail.com>
---
tools/lib/bpf/btf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/lib/bpf/btf.c b/tools/lib/bpf/btf.c
index dd2badf1a54e..2c89454c0136 100644
--- a/tools/lib/bpf/btf.c
+++ b/tools/lib/bpf/btf.c
@@ -991,7 +991,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);
--
2.37.2
\
 
 \ /
  Last update: 2023-03-26 23:24    [W:0.054 / U:0.236 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site