]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
bpf-link: Add HAVE_LIBBPF check
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Fri, 16 May 2025 10:36:32 +0000 (12:36 +0200)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 16 May 2025 12:36:15 +0000 (21:36 +0900)
Fixes compilation error in userns-restrict.c where we try to include
libbpf.h when it is not available.

src/shared/bpf-link.h

index 402327a5a3dacc3055ac49dcb86187fcf0dd82e1..53711e49053063f19f8830964bb7d5774d2d8ac0 100644 (file)
@@ -2,6 +2,8 @@
 
 #pragma once
 
+#if HAVE_LIBBPF
+
 #include <stdio.h>
 #include <bpf/libbpf.h>
 
@@ -17,3 +19,5 @@ DEFINE_TRIVIAL_CLEANUP_FUNC(struct bpf_link *, bpf_link_free);
 
 struct ring_buffer* bpf_ring_buffer_free(struct ring_buffer *rb);
 DEFINE_TRIVIAL_CLEANUP_FUNC(struct ring_buffer *, bpf_ring_buffer_free);
+
+#endif