aboutsummaryrefslogtreecommitdiffstats
path: root/tools/lib/bpf/elf.c
diff options
context:
space:
mode:
authorMykyta Yatsenko <[email protected]>2024-11-11 21:29:19 +0000
committerAndrii Nakryiko <[email protected]>2024-11-12 04:29:45 +0000
commit4ce16ddd71054b1e47a65f8af5e3af6b64908e46 (patch)
treeb4b70b0c4561728a2b9d8bfcdcaed6d096873ca2 /tools/lib/bpf/elf.c
parentlibbpf: Stringify errno in log messages in btf*.c (diff)
downloadkernel-4ce16ddd71054b1e47a65f8af5e3af6b64908e46.tar.gz
kernel-4ce16ddd71054b1e47a65f8af5e3af6b64908e46.zip
libbpf: Stringify errno in log messages in the remaining code
Convert numeric error codes into the string representations in log messages in the rest of libbpf source files. Signed-off-by: Mykyta Yatsenko <[email protected]> Signed-off-by: Andrii Nakryiko <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'tools/lib/bpf/elf.c')
-rw-r--r--tools/lib/bpf/elf.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/tools/lib/bpf/elf.c b/tools/lib/bpf/elf.c
index b5ab1cb13e5e..823f83ad819c 100644
--- a/tools/lib/bpf/elf.c
+++ b/tools/lib/bpf/elf.c
@@ -24,7 +24,6 @@
int elf_open(const char *binary_path, struct elf_fd *elf_fd)
{
- char errmsg[STRERR_BUFSIZE];
int fd, ret;
Elf *elf;
@@ -38,8 +37,7 @@ int elf_open(const char *binary_path, struct elf_fd *elf_fd)
fd = open(binary_path, O_RDONLY | O_CLOEXEC);
if (fd < 0) {
ret = -errno;
- pr_warn("elf: failed to open %s: %s\n", binary_path,
- libbpf_strerror_r(ret, errmsg, sizeof(errmsg)));
+ pr_warn("elf: failed to open %s: %s\n", binary_path, errstr(ret));
return ret;
}
elf = elf_begin(fd, ELF_C_READ_MMAP, NULL);