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:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user