mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-10 23:07:44 +00:00
network: avoid including sys/sysctl.h on Linux
The sys/sysctl.h header is only needed on BSD platforms to get the sysctlbyname() function declaration. On Linux we talk to procfs instead to change sysctls. Unfortunately a legacy sys/sysctl.h header does exist on Linux and including it has recently started triggering a deprecation warning from glibc. Protect its inclusion with a HAVE_SYSCTLBYNAME check instead so that it only gets used on platforms where we need that function declaration. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
05807e5d42
commit
3338c40b47
@ -33,7 +33,7 @@
|
||||
#include <sys/wait.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <net/if.h>
|
||||
#if HAVE_SYS_SYSCTL_H
|
||||
#ifdef HAVE_SYSCTLBYNAME
|
||||
# include <sys/sysctl.h>
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user