bpf-util: merge two dlopen_bpf() declaration

No functional change. Just for consistency with other dlopen_libfoo().
This commit is contained in:
Yu Watanabe
2026-07-10 16:29:54 +09:00
parent 6aa24f1c8a
commit 0740a5f1c7
+8 -7
View File
@@ -76,7 +76,10 @@ static int bpf_print_func(enum libbpf_print_level level, const char *fmt, va_lis
return log_internalv(LOG_DEBUG, errno, NULL, 0, NULL, fmt, ap);
}
#endif
int dlopen_bpf(int log_level) {
#if HAVE_LIBBPF
static void *bpf_dl = NULL;
static int cached = 0;
int r = -ENOENT;
@@ -153,8 +156,13 @@ int dlopen_bpf(int log_level) {
(void) sym_libbpf_set_print(bpf_print_func);
return 1;
#else
return log_once_errno(log_level, SYNTHETIC_ERRNO(EOPNOTSUPP),
"libbpf support is not compiled in, cgroup BPF features disabled.");
#endif
}
#if HAVE_LIBBPF
int bpf_get_error_translated(const void *ptr) {
int r;
@@ -171,11 +179,4 @@ int bpf_get_error_translated(const void *ptr) {
return r;
}
}
#else
int dlopen_bpf(int log_level) {
return log_once_errno(log_level, SYNTHETIC_ERRNO(EOPNOTSUPP),
"libbpf support is not compiled in, cgroup BPF features disabled.");
}
#endif