lkml.org 
[lkml]   [2020]   [Nov]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] tools/bpf: Return the appropriate error value
Date
Compile times error:
"Error: failed to load BTF from /mnt/linux/vmlinux: No such file or directory".
This file "/mnt/linux/vmlinux" actually exists, but only because CONFIG_DEBUG_INFO_BTF
is not configured with this error.

Signed-off-by: Peng Hao <richard.peng@oppo.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 231b07203e3d..228f508fbd04 100644
--- a/tools/lib/bpf/btf.c
+++ b/tools/lib/bpf/btf.c
@@ -865,7 +865,7 @@ struct btf *btf__parse_elf(const char *path, struct btf_ext **btf_ext)
err = 0;

if (!btf_data) {
- err = -ENOENT;
+ err = -EPROTO;
goto done;
}
btf = btf__new(btf_data->d_buf, btf_data->d_size);
--
2.18.4
\
 
 \ /
  Last update: 2020-12-01 04:05    [W:0.043 / U:1.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site