mirror of
https://github.com/netdata/libbpf.git
synced 2026-03-24 02:09:06 +08:00
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 <yatsenko@meta.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/bpf/20241111212919.368971-5-mykyta.yatsenko5@gmail.com
This commit is contained in:
committed by
Andrii Nakryiko
parent
da7d63a690
commit
db73e46709
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user