[libdvdnav-devel] [Git][videolan/libdvdread][master] only use getmntent_r if available

Thomas Guillem gitlab at videolan.org
Fri Oct 25 09:51:40 CEST 2019



Thomas Guillem pushed to branch master at VideoLAN / libdvdread


Commits:
da2245e4 by Marvin Scholz at 2019-10-24T12:42:55Z
only use getmntent_r if available

- - - - -


2 changed files:

- configure.ac
- src/dvd_reader.c


Changes:

=====================================
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@:>@]))
 


=====================================
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"



View it on GitLab: https://code.videolan.org/videolan/libdvdread/commit/da2245e4eccca4b8816ecba3d99c6c2134e3d07c

-- 
View it on GitLab: https://code.videolan.org/videolan/libdvdread/commit/da2245e4eccca4b8816ecba3d99c6c2134e3d07c
You're receiving this email because of your account on code.videolan.org.




More information about the libdvdnav-devel mailing list