Skip to content

Commit

Permalink
guard sysctl.h include with pre-existing autoconf check
Browse files Browse the repository at this point in the history
* 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: #87
Signed-off-by: Alfred Wingate <parona@protonmail.com>
  • Loading branch information
parona-source committed Oct 28, 2023
1 parent 290d886 commit 1812e3e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion libxo/xo_syslog.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,16 @@
#include <stdarg.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/sysctl.h>

#include "xo_config.h"
#include "xo.h"
#include "xo_encoder.h" /* For xo_realloc */
#include "xo_buf.h"

#ifdef HAVE_SYS_SYSCTL_H
#include <sys/sysctl.h>
#endif

/*
* SYSLOG (RFC 5424) requires an enterprise identifier. This turns
* out to be a fickle little issue. For a single-vendor box, the
Expand Down

0 comments on commit 1812e3e

Please sign in to comment.