From 3338c40b471024d9730bb8eaffd03030653f2461 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Date: Wed, 26 Jun 2019 14:34:20 +0100 Subject: [PATCH] network: avoid including sys/sysctl.h on Linux MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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é --- src/network/bridge_driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- GitLab