From: Yu Watanabe Date: Mon, 6 Jul 2026 23:02:01 +0000 (+0900) Subject: bpf-util: merge two dlopen_bpf() declaration X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0740a5f1c72cb0eae565680390a97fc5ecd77e25;p=thirdparty%2Fsystemd.git bpf-util: merge two dlopen_bpf() declaration No functional change. Just for consistency with other dlopen_libfoo(). --- diff --git a/src/shared/bpf-util.c b/src/shared/bpf-util.c index 92fc05f8fc8..6cd4069580a 100644 --- a/src/shared/bpf-util.c +++ b/src/shared/bpf-util.c @@ -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