From fc98ef6d53fe28b690ca2b67d96cde766d1432c6 Mon Sep 17 00:00:00 2001 From: Stephan Hartmann Date: Thu, 26 Mar 2020 10:21:53 +0100 Subject: [PATCH] sys-apps/heirloom-tools: fix build with glibc 2.31 Closes: https://bugs.gentoo.org/709410 Package-Manager: Portage-2.3.89, Repoman-2.3.20 Signed-off-by: Stephan Hartmann Signed-off-by: David Seifert --- .../heirloom-tools-070715-glibc-2.31.patch | 41 +++++++++++++++++++ .../heirloom-tools-070715-r1.ebuild | 1 + 2 files changed, 42 insertions(+) create mode 100644 sys-apps/heirloom-tools/files/heirloom-tools-070715-glibc-2.31.patch diff --git a/sys-apps/heirloom-tools/files/heirloom-tools-070715-glibc-2.31.patch b/sys-apps/heirloom-tools/files/heirloom-tools-070715-glibc-2.31.patch new file mode 100644 index 000000000000..5186aa1cc2e1 --- /dev/null +++ b/sys-apps/heirloom-tools/files/heirloom-tools-070715-glibc-2.31.patch @@ -0,0 +1,41 @@ +--- a/date/date.c ++++ b/date/date.c +@@ -134,26 +134,13 @@ badtime: + return (time_t)-1; + } + +-#if defined (__FreeBSD__) || defined (__NetBSD__) || defined (__OpenBSD__) || \ +- defined (__DragonFly__) || defined (__APPLE__) +-static int +-stime(time_t *t) +-{ +- struct timeval tv; +- +- tv.tv_sec = *t; +- tv.tv_usec = 0; +- +- return settimeofday(&tv, NULL); +-} +-#endif /* __FreeBSD__, __NetBSD__, __OpenBSD__, __DragonFly__, __APPLE__ */ +- + static void + settime(char *op) + { + struct utmpx before, after; + const char wtmpxfile[] = "/var/log/wtmp"; + time_t newtime; ++ struct timeval tv; + + memset(&before, 0, sizeof before); + memset(&after, 0, sizeof after); +@@ -164,7 +151,9 @@ settime(char *op) + if ((newtime = timeop(op)) == (time_t)-1) + badconv(); + gettimeofday(&before.ut_tv, NULL); +- if (stime(&newtime) < 0) { ++ tv.tv_sec = newtime; ++ tv.tv_usec = 0; ++ if (settimeofday(&tv, NULL) < 0) { + fprintf(stderr, "%s: no permission\n", progname); + exit(1); + } diff --git a/sys-apps/heirloom-tools/heirloom-tools-070715-r1.ebuild b/sys-apps/heirloom-tools/heirloom-tools-070715-r1.ebuild index 80d2232221aa..26da82f5c8b6 100644 --- a/sys-apps/heirloom-tools/heirloom-tools-070715-r1.ebuild +++ b/sys-apps/heirloom-tools/heirloom-tools-070715-r1.ebuild @@ -24,6 +24,7 @@ S="${WORKDIR}/heirloom-${PV}" PATCHES=( "${FILESDIR}"/${P}-major.patch "${FILESDIR}"/${P}-glibc-2.30.patch + "${FILESDIR}"/${P}-glibc-2.31.patch ) # slightly broken -- 2.26.2