media-video/vdr: glibc-2.24 deprecated warning fixed
authorJoerg Bornkessel <hd_brummy@gentoo.org>
Mon, 27 Aug 2018 13:30:59 +0000 (15:30 +0200)
committerJoerg Bornkessel <hd_brummy@gentoo.org>
Mon, 27 Aug 2018 13:31:53 +0000 (15:31 +0200)
Package-Manager: Portage-2.3.48, Repoman-2.3.10

media-video/vdr/files/vdr-2.2.0_glibc-2.24.patch [new file with mode: 0644]
media-video/vdr/vdr-2.2.0-r3.ebuild

diff --git a/media-video/vdr/files/vdr-2.2.0_glibc-2.24.patch b/media-video/vdr/files/vdr-2.2.0_glibc-2.24.patch
new file mode 100644 (file)
index 0000000..98cc13b
--- /dev/null
@@ -0,0 +1,35 @@
+patch will fix readdir_r() is deprecated as of glibc-2.24
+https://www.vdr-portal.de/forum/index.php?thread/130752-handle-deprecated-functions-readdir-r-auto-ptr/&postID=1293833#post1293833
+
+Signed-of by: Joerg Bornkessel <hd_brummy@gentoo.org> (27 Aug 2018)
+diff -Naur vdr-2.2.0.orig/tools.c vdr-2.2.0/tools.c
+--- vdr-2.2.0.orig/tools.c     2018-08-27 12:59:28.571326559 +0200
++++ vdr-2.2.0/tools.c  2018-08-27 13:03:11.222326559 +0200
+@@ -1466,7 +1466,11 @@
+ struct dirent *cReadDir::Next(void)
+ {
+   if (directory) {
++#if !__GLIBC_PREREQ(2, 24) // readdir_r() is deprecated as of GLIBC 2.24
+      while (readdir_r(directory, &u.d, &result) == 0 && result) {
++#else
++     while ((result = readdir(directory)) != NULL) {
++#endif
+            if (strcmp(result->d_name, ".") && strcmp(result->d_name, ".."))
+               return result;
+            }
+diff -Naur vdr-2.2.0.orig/tools.h vdr-2.2.0/tools.h
+--- vdr-2.2.0.orig/tools.h     2018-08-27 12:59:28.641326559 +0200
++++ vdr-2.2.0/tools.h  2018-08-27 13:01:44.022326559 +0200
+@@ -369,10 +369,12 @@
+ private:
+   DIR *directory;
+   struct dirent *result;
++#if !__GLIBC_PREREQ(2, 24) // readdir_r() is deprecated as of GLIBC 2.24
+   union { // according to "The GNU C Library Reference Manual"
+     struct dirent d;
+     char b[offsetof(struct dirent, d_name) + NAME_MAX + 1];
+     } u;
++#endif
+ public:
+   cReadDir(const char *Directory);
+   ~cReadDir();
index 2b4a137a165ad0f205943f4106772696e52bbce2..dbb8e986c4a5ae9095d72759d639a773f31cf9fd 100644 (file)
@@ -218,6 +218,7 @@ src_prepare() {
        eapply "${FILESDIR}/${P}_gentoo.patch"
        #gcc-7.2, this will fix only the core vdr, not the extpatch
        eapply "${FILESDIR}/${P}_unsignedtosigned.patch"
+       eapply "${FILESDIR}/${P}_glibc-2.24.patch"
 
        # fix some makefile issues
        sed -e "s:ifndef NO_KBD:ifeq (\$(USE_KBD),1):" \