From: Daniel P. Berrangé Date: Wed, 26 Jun 2019 13:34:20 +0000 (+0100) Subject: network: avoid including sys/sysctl.h on Linux X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=3338c40b471024d9730bb8eaffd03030653f2461;p=libvirt.git 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é --- diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index 465487432e..19faf7d514 100644 --- a/src/network/bridge_driver.c +++ b/src/network/bridge_driver.c @@ -33,7 +33,7 @@ #include #include #include -#if HAVE_SYS_SYSCTL_H +#ifdef HAVE_SYSCTLBYNAME # include #endif