test-bpf-token: fix build with libbpf < 0.6

../s/src/test/test-bpf-token.c: In function ‘intro’:
../s/src/test/test-bpf-token.c:10:5: error: "__LIBBPF_CURRENT_VERSION_GEQ" is not defined, evaluates to 0 [-Werror=undef]
   10 | #if __LIBBPF_CURRENT_VERSION_GEQ(1, 5)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
../s/src/test/test-bpf-token.c:10:33: error: missing binary operator before token "("
   10 | #if __LIBBPF_CURRENT_VERSION_GEQ(1, 5)

Follow-up for ea9826eb94
This commit is contained in:
Luca Boccassi
2025-08-06 14:09:33 +01:00
parent 7108a882b3
commit 64a4f3110a
+1 -1
View File
@@ -7,7 +7,7 @@
#include "tests.h"
static int intro(void) {
#if __LIBBPF_CURRENT_VERSION_GEQ(1, 5)
#if defined(LIBBPF_MAJOR_VERSION) && (LIBBPF_MAJOR_VERSION > 1 || (LIBBPF_MAJOR_VERSION == 1 && LIBBPF_MINOR_VERSION >= 5))
_cleanup_close_ int bpffs_fd = open("/sys/fs/bpf", O_RDONLY);
if (bpffs_fd < 0)
return log_error_errno(errno, "Failed to open '/sys/fs/bpf': %m");