[prev in list] [next in list] [prev in thread] [next in thread]
List: coreutils
Subject: [PATCH] build: avoid including sysctl.h on glibc
From: Pádraig Brady <P () draigBrady ! com>
Date: 2020-02-02 15:55:54
Message-ID: 20200202155554.40358-1-P () draigBrady ! com
[Download RAW message or body]
* src/uname.c: Avoid unneeded header with GLIBC,
which has been deprecated since glibc-2.30.
* src/uptime.c: Likewise.
---
src/uname.c | 2 +-
src/uptime.c | 5 +++--
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/uname.c b/src/uname.c
index 63758c244..4065bf29e 100644
--- a/src/uname.c
+++ b/src/uname.c
@@ -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
diff --git a/src/uptime.c b/src/uptime.c
index 9749ca81a..a42e702b5 100644
--- a/src/uptime.c
+++ b/src/uptime.c
@@ -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 };
--
2.24.1
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic