bpf: actually check for errors when loading symbols
Also restructure ifdef to avoid confusing vscode
Follow-up for 87e462f713
This commit is contained in:
@@ -82,11 +82,12 @@ int dlopen_bpf(void) {
|
||||
#if MODERN_LIBBPF
|
||||
/* Don't exist anymore in new libbpf, hence cannot type check them */
|
||||
DLSYM_ARG_FORCE(bpf_create_map),
|
||||
DLSYM_ARG_FORCE(bpf_probe_prog_type));
|
||||
DLSYM_ARG_FORCE(bpf_probe_prog_type)
|
||||
#else
|
||||
DLSYM_ARG(bpf_create_map),
|
||||
DLSYM_ARG(bpf_probe_prog_type));
|
||||
DLSYM_ARG(bpf_probe_prog_type)
|
||||
#endif
|
||||
);
|
||||
} else {
|
||||
/* symbols available from 0.7.0 */
|
||||
r = dlsym_many_or_warn(
|
||||
@@ -101,6 +102,8 @@ int dlopen_bpf(void) {
|
||||
#endif
|
||||
);
|
||||
}
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
r = dlsym_many_or_warn(
|
||||
dl, LOG_DEBUG,
|
||||
|
||||
Reference in New Issue
Block a user