[vlc-devel] commit: file access: only use linux/magic.h when it's present ( Rafaël Carré )

git version control git at videolan.org
Mon Aug 31 16:02:11 CEST 2009


vlc | branch: master | Rafaël Carré <rafael.carre at gmail.com> | Mon Aug 31 16:01:47 2009 +0200| [c6d58bc3e628f035a27a5485ba4ec6c02f30c914] | committer: Rafaël Carré 

file access: only use linux/magic.h when it's present

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c6d58bc3e628f035a27a5485ba4ec6c02f30c914
---

 configure.ac          |    2 +-
 modules/access/file.c |    7 +++++--
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/configure.ac b/configure.ac
index 3e4ddb0..82b7076 100644
--- a/configure.ac
+++ b/configure.ac
@@ -863,7 +863,7 @@ AC_CHECK_HEADERS([net/if.h], [], [],
   ])
 if test "${SYS}" != "mingw32" -a "${SYS}" != "mingwce"; then
 AC_CHECK_HEADERS(machine/param.h sys/shm.h)
-AC_CHECK_HEADERS([linux/version.h linux/dccp.h scsi/scsi.h])
+AC_CHECK_HEADERS([linux/version.h linux/dccp.h scsi/scsi.h linux/magic.h])
 AC_CHECK_HEADERS(syslog.h)
 fi # end "${SYS}" != "mingw32" -a "${SYS}" != "mingwce"
 
diff --git a/modules/access/file.c b/modules/access/file.c
index 4d5c7f6..c105b9b 100644
--- a/modules/access/file.c
+++ b/modules/access/file.c
@@ -49,7 +49,9 @@
 #endif
 #if defined (__linux__)
 #   include <sys/vfs.h>
+#ifdef HAVE_LINUX_MAGIC_H
 #   include <linux/magic.h>
+#endif
 #elif defined (HAVE_SYS_MOUNT_H)
 #   include <sys/param.h>
 #   include <sys/mount.h>
@@ -143,7 +145,8 @@ static bool IsRemote (int fd)
 #if defined(MNT_LOCAL)
     return !(stf.f_flags & MNT_LOCAL);
 
-#elif defined (__linux__)
+#else
+#   ifdef HAVE_LINUX_MAGIC_H
     switch (stf.f_type)
     {
         case AFS_SUPER_MAGIC:
@@ -155,7 +158,7 @@ static bool IsRemote (int fd)
             return true;
     }
     return false;
-
+#   endif
 #endif
 #else /* !HAVE_FSTATFS */
     (void)fd;




More information about the vlc-devel mailing list