Commit c6d58bc3 authored by Rafaël Carré's avatar Rafaël Carré
Browse files

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

parent 087681d6
...@@ -863,7 +863,7 @@ AC_CHECK_HEADERS([net/if.h], [], [], ...@@ -863,7 +863,7 @@ AC_CHECK_HEADERS([net/if.h], [], [],
]) ])
if test "${SYS}" != "mingw32" -a "${SYS}" != "mingwce"; then if test "${SYS}" != "mingw32" -a "${SYS}" != "mingwce"; then
AC_CHECK_HEADERS(machine/param.h sys/shm.h) 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) AC_CHECK_HEADERS(syslog.h)
fi # end "${SYS}" != "mingw32" -a "${SYS}" != "mingwce" fi # end "${SYS}" != "mingw32" -a "${SYS}" != "mingwce"
......
...@@ -49,7 +49,9 @@ ...@@ -49,7 +49,9 @@
#endif #endif
#if defined (__linux__) #if defined (__linux__)
# include <sys/vfs.h> # include <sys/vfs.h>
#ifdef HAVE_LINUX_MAGIC_H
# include <linux/magic.h> # include <linux/magic.h>
#endif
#elif defined (HAVE_SYS_MOUNT_H) #elif defined (HAVE_SYS_MOUNT_H)
# include <sys/param.h> # include <sys/param.h>
# include <sys/mount.h> # include <sys/mount.h>
...@@ -143,7 +145,8 @@ static bool IsRemote (int fd) ...@@ -143,7 +145,8 @@ static bool IsRemote (int fd)
#if defined(MNT_LOCAL) #if defined(MNT_LOCAL)
return !(stf.f_flags & MNT_LOCAL); return !(stf.f_flags & MNT_LOCAL);
#elif defined (__linux__) #else
# ifdef HAVE_LINUX_MAGIC_H
switch (stf.f_type) switch (stf.f_type)
{ {
case AFS_SUPER_MAGIC: case AFS_SUPER_MAGIC:
...@@ -155,7 +158,7 @@ static bool IsRemote (int fd) ...@@ -155,7 +158,7 @@ static bool IsRemote (int fd)
return true; return true;
} }
return false; return false;
# endif
#endif #endif
#else /* !HAVE_FSTATFS */ #else /* !HAVE_FSTATFS */
(void)fd; (void)fd;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment