1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-04-20 18:56:39 +02:00

build: avoid including sysctl.h on glibc

* src/uname.c: Avoid unneeded header with GLIBC,
which has been deprecated since glibc-2.30.
* src/uptime.c: Likewise.
This commit is contained in:
Pádraig Brady
2020-02-02 15:52:59 +00:00
parent 2cecc3cc99
commit 18c9382801
2 changed files with 4 additions and 3 deletions

View 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

View 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 };