]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Do not use <sys/sysctl.h> on Linux
authorMichał Kępień <michal@isc.org>
Wed, 6 Nov 2019 14:31:47 +0000 (15:31 +0100)
committerMichał Kępień <michal@isc.org>
Wed, 6 Nov 2019 15:00:02 +0000 (16:00 +0100)
glibc 2.30 deprecated the <sys/sysctl.h> header [1].  However, that
header is still used on other Unix-like systems, so only prevent it from
being used on Linux, in order to prevent compiler warnings from being
triggered.

[1] https://sourceware.org/ml/libc-alpha/2019-08/msg00029.html

(cherry picked from commit 65a8b53bd06bff2debf1e58ed3168ad89e69c0fa)

lib/isc/unix/meminfo.c
lib/isc/unix/net.c
lib/isc/unix/socket.c

index ad750a70f3b29339d5bd29677499905483bc332b..2b5510bd9ccbe45af7d6081cb8b83b821442f00b 100644 (file)
@@ -14,7 +14,7 @@
 #include <isc/meminfo.h>
 #include <inttypes.h>
 #include <unistd.h>
-#ifdef HAVE_SYS_SYSCTL_H
+#if defined(HAVE_SYS_SYSCTL_H) && !defined(__linux__)
 #include <sys/sysctl.h>
 #endif
 
index 98abab507782cb42ddc50545b3e7ac895c63af39..d5e809bfcf8617a3be4d083377480b53f9f2abe3 100644 (file)
@@ -15,7 +15,7 @@
 #include <stdbool.h>
 #include <sys/types.h>
 
-#if defined(HAVE_SYS_SYSCTL_H)
+#if defined(HAVE_SYS_SYSCTL_H) && !defined(__linux__)
 #if defined(HAVE_SYS_PARAM_H)
 #include <sys/param.h>
 #endif
index dd79524df1502803e9a08d249cd58641d00211d8..aae6fa0fa5a244fb569cc870247e90a9b7c84c49 100644 (file)
@@ -20,7 +20,7 @@
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <sys/stat.h>
-#ifdef HAVE_SYS_SYSCTL_H
+#if defined(HAVE_SYS_SYSCTL_H) && !defined(__linux__)
 #include <sys/sysctl.h>
 #endif
 #include <sys/time.h>