Browse Source

bluray: check for getmntent_r symbol

getmntent_r is not necessarily available when the mntent.h header is present
(cf.  Android).
pull/100/head
Thomas Guillem 7 years ago
parent
commit
731510839d
  1. 4
      configure.ac
  2. 4
      modules/access/bluray.c

4
configure.ac

@ -639,7 +639,7 @@ dnl Check for system libs needed
need_libc=false
dnl Check for usual libc functions
AC_CHECK_FUNCS([accept4 daemon fcntl flock fstatat fstatvfs fork getenv getpwuid_r isatty memalign mkostemp mmap open_memstream newlocale pipe2 pread posix_fadvise posix_madvise setlocale stricmp strnicmp strptime uselocale])
AC_CHECK_FUNCS([accept4 daemon fcntl flock fstatat fstatvfs fork getmntent_r getenv getpwuid_r isatty memalign mkostemp mmap open_memstream newlocale pipe2 pread posix_fadvise posix_madvise setlocale stricmp strnicmp strptime uselocale])
AC_REPLACE_FUNCS([aligned_alloc atof atoll dirfd fdopendir flockfile fsync getdelim getpid lfind lldiv memrchr nrand48 poll posix_memalign recvmsg rewind sendmsg setenv strcasecmp strcasestr strdup strlcpy strndup strnlen strnstr strsep strtof strtok_r strtoll swab tdestroy tfind timegm timespec_get strverscmp pathconf])
AC_REPLACE_FUNCS([gettimeofday])
AC_CHECK_FUNC(fdatasync,,
@ -900,7 +900,7 @@ dnl BSD
AC_CHECK_HEADERS([netinet/tcp.h netinet/udplite.h sys/param.h sys/mount.h])
dnl GNU/Linux
AC_CHECK_HEADERS([features.h getopt.h linux/dccp.h linux/magic.h mntent.h sys/eventfd.h])
AC_CHECK_HEADERS([features.h getopt.h linux/dccp.h linux/magic.h sys/eventfd.h])
dnl MacOS
AC_CHECK_HEADERS([xlocale.h])

4
modules/access/bluray.c

@ -28,7 +28,7 @@
#include <assert.h>
#include <stdatomic.h>
#if defined (HAVE_MNTENT_H) && defined(HAVE_SYS_STAT_H)
#ifdef HAVE_GETMNTENT_R
# include <mntent.h>
#endif
#include <fcntl.h> /* O_* */
@ -545,7 +545,7 @@ static void notifyDiscontinuityToParser( demux_sys_t *p_sys );
static void FindMountPoint(char **file)
{
char *device = *file;
#if defined (HAVE_MNTENT_H) && defined (HAVE_SYS_STAT_H)
#ifdef HAVE_GETMNTENT_R
/* bd path may be a symlink (e.g. /dev/dvd -> /dev/sr0), so make sure
* we look up the real device */
char *bd_device = realpath(device, NULL);

Loading…
Cancel
Save