vlc | branch: master | Konstantin Pavlov <[email protected]> | Sun Oct 27 11:26:22 2019 +0300| [d093faddc011f3787ab6e3840bc8da30627d2495] | committer: Konstantin Pavlov
contrib: dvdread: only use getmntent_r when available This is a backport of an upstream patch da2245e4eccca4b8816ecba3d99c6c2134e3d07c, to be dropped on dvdread version bump. > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d093faddc011f3787ab6e3840bc8da30627d2495 --- .../only-use-getmntentr-when-available.patch | 48 ++++++++++++++++++++++ contrib/src/dvdread/rules.mak | 1 + 2 files changed, 49 insertions(+) diff --git a/contrib/src/dvdread/only-use-getmntentr-when-available.patch b/contrib/src/dvdread/only-use-getmntentr-when-available.patch new file mode 100644 index 0000000000..52a2e3ed57 --- /dev/null +++ b/contrib/src/dvdread/only-use-getmntentr-when-available.patch @@ -0,0 +1,48 @@ +From da2245e4eccca4b8816ecba3d99c6c2134e3d07c Mon Sep 17 00:00:00 2001 +From: Marvin Scholz <[email protected]> +Date: Thu, 24 Oct 2019 14:42:55 +0200 +Subject: [PATCH] only use getmntent_r if available + +--- + configure.ac | 3 +++ + src/dvd_reader.c | 7 ++++++- + 2 files changed, 9 insertions(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index 78a8c3b..b2754bb 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -65,6 +65,9 @@ AS_CASE([$host], + AS_CASE([$host], + [*-os2-*], LDFLAGS="-no-undefined -Zbin-files $LDFLAGS") + ++AS_CASE([$host], ++ [*-linux-*], [AC_CHECK_FUNCS([getmntent_r])]) ++ + AC_ARG_WITH([libdvdcss], + AS_HELP_STRING([--with-libdvdcss], [Link directly against libdvdcss @<:@default=no@:>@])) + +diff --git a/src/dvd_reader.c b/src/dvd_reader.c +index 27dd527..6cea7b5 100644 +--- a/src/dvd_reader.c ++++ b/src/dvd_reader.c +@@ -543,10 +543,15 @@ static dvd_reader_t *DVDOpenCommon( const char *ppath, + #elif defined(__linux__) + mntfile = fopen( _PATH_MOUNTED, "r" ); + if( mntfile ) { ++ ++#ifdef HAVE_GETMNTENT_R + struct mntent *me, mbuf; + char buf [8192]; +- + while( ( me = getmntent_r( mntfile, &mbuf, buf, sizeof(buf) ) ) ) { ++#else ++ struct mntent *me; ++ while( ( me = getmntent( mntfile ) ) ) { ++#endif + if( !strcmp( me->mnt_dir, path_copy ) ) { + fprintf( stderr, + "libdvdread: Attempting to use device %s" +-- +2.22.0 + diff --git a/contrib/src/dvdread/rules.mak b/contrib/src/dvdread/rules.mak index 32754605eb..56865450e4 100644 --- a/contrib/src/dvdread/rules.mak +++ b/contrib/src/dvdread/rules.mak @@ -20,6 +20,7 @@ $(TARBALLS)/libdvdread-$(LIBDVDREAD_VERSION).tar.bz2: dvdread: libdvdread-$(LIBDVDREAD_VERSION).tar.bz2 .sum-dvdread $(UNPACK) + $(APPLY) $(SRC)/dvdread/only-use-getmntentr-when-available.patch $(call pkg_static,"misc/dvdread.pc.in") $(MOVE) _______________________________________________ vlc-commits mailing list [email protected] https://mailman.videolan.org/listinfo/vlc-commits
