]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
build: avoid including sysctl.h on glibc
authorPádraig Brady <P@draigBrady.com>
Sun, 2 Feb 2020 15:52:59 +0000 (15:52 +0000)
committerPádraig Brady <P@draigBrady.com>
Mon, 3 Feb 2020 19:38:02 +0000 (19:38 +0000)
* src/uname.c: Avoid unneeded header with GLIBC,
which has been deprecated since glibc-2.30.
* src/uptime.c: Likewise.

src/uname.c
src/uptime.c

index 63758c2446e71510229e560ca6b9e97068203f0b..4065bf29eb0b0d09321b789291b94b442f6c24dd 100644 (file)
@@ -27,7 +27,7 @@
 # include <sys/systeminfo.h>
 #endif
 
-#if HAVE_SYS_SYSCTL_H
+#if HAVE_SYS_SYSCTL_H && ! defined __GLIBC__
 # if HAVE_SYS_PARAM_H
 #  include <sys/param.h> /* needed for OpenBSD 3.0 */
 # endif
index 9749ca81a358276d7f99ccb4a07b5e152a3692c0..a42e702b51b3eb8727e939f0d53f7af5b21586e5 100644 (file)
@@ -22,7 +22,7 @@
 #include <sys/types.h>
 #include "system.h"
 
-#if HAVE_SYSCTL && HAVE_SYS_SYSCTL_H
+#if HAVE_SYSCTL && HAVE_SYS_SYSCTL_H && ! defined __GLIBC__
 # include <sys/sysctl.h>
 #endif
 
@@ -80,7 +80,8 @@ print_uptime (size_t n, const STRUCT_UTMP *this)
     }
 #endif /* HAVE_PROC_UPTIME */
 
-#if HAVE_SYSCTL && defined CTL_KERN && defined KERN_BOOTTIME
+#if HAVE_SYSCTL && ! defined __GLIBC__ \
+    && defined CTL_KERN && defined KERN_BOOTTIME
   {
     /* FreeBSD specific: fetch sysctl "kern.boottime".  */
     static int request[2] = { CTL_KERN, KERN_BOOTTIME };