From f7b886babdbdf8bff7f095da3450fc460434d2b0 Mon Sep 17 00:00:00 2001 From: Alfred Wingate Date: Sat, 28 Oct 2023 04:18:08 +0300 Subject: [PATCH] guard sysctl.h include with pre-existing autoconf check * HAVE_SYSCTLBYNAME and HAVE_SYS_SYSCTL could be paired together as sysctlbyname isn't available if sysctl.h isn't available. * Sysctl syscall isn't available in linux >=5.5 and the header is absent in glibc-2.32 and musl-1.0.0 Closes: https://github.com/Juniper/libxo/issues/87 Signed-off-by: Alfred Wingate --- libxo/xo_syslog.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libxo/xo_syslog.c b/libxo/xo_syslog.c index 62da1811..4a16c3a5 100644 --- a/libxo/xo_syslog.c +++ b/libxo/xo_syslog.c @@ -58,7 +58,9 @@ #include #include #include +#ifdef HAVE_SYS_SYSCTL #include +#endif #include "xo_config.h" #include "xo.h"