From 1812e3ed2654809e69657c340206842c0b100ac8 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 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libxo/xo_syslog.c b/libxo/xo_syslog.c index 62da1811..0e03916e 100644 --- a/libxo/xo_syslog.c +++ b/libxo/xo_syslog.c @@ -58,13 +58,16 @@ #include #include #include -#include #include "xo_config.h" #include "xo.h" #include "xo_encoder.h" /* For xo_realloc */ #include "xo_buf.h" +#ifdef HAVE_SYS_SYSCTL_H +#include +#endif + /* * SYSLOG (RFC 5424) requires an enterprise identifier. This turns * out to be a fickle little issue. For a single-vendor box, the