sys-apps/heirloom-tools: fix build with glibc 2.31
authorStephan Hartmann <stha09@googlemail.com>
Thu, 26 Mar 2020 09:21:53 +0000 (10:21 +0100)
committerDavid Seifert <soap@gentoo.org>
Thu, 26 Mar 2020 09:21:53 +0000 (10:21 +0100)
Closes: https://bugs.gentoo.org/709410
Package-Manager: Portage-2.3.89, Repoman-2.3.20
Signed-off-by: Stephan Hartmann <stha09@googlemail.com>
Signed-off-by: David Seifert <soap@gentoo.org>
sys-apps/heirloom-tools/files/heirloom-tools-070715-glibc-2.31.patch [new file with mode: 0644]
sys-apps/heirloom-tools/heirloom-tools-070715-r1.ebuild

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 (file)
index 0000000..5186aa1
--- /dev/null
@@ -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);
+       }
index 80d2232221aafeeb48545c6f1d901182eb7f43be..26da82f5c8b6dc3a146e6c0748a2ad2ec6a71e55 100644 (file)
@@ -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