]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
build: avoid compile failure on linux kernels older than 2.6.19
authorJim Meyering <meyering@redhat.com>
Mon, 17 May 2010 14:17:08 +0000 (16:17 +0200)
committerJim Meyering <meyering@redhat.com>
Mon, 17 May 2010 14:50:36 +0000 (16:50 +0200)
* configure.ac: Check for <linux/magic.h>.
* src/util/storage_file.c: Include <linux/magic.h> only if present.
Linux kernels prior to 2.6.19 lacked it.
[__linux__] (NFS_SUPER_MAGIC): Define if not already defined.

configure.ac
src/util/storage_file.c

index c18742073951ca50305daeaacdf3a458d2af2ffd..ebd208240e7da34a6c396824edc151204a544445 100644 (file)
@@ -108,7 +108,7 @@ LIBS=$old_libs
 
 dnl Availability of various common headers (non-fatal if missing).
 AC_CHECK_HEADERS([pwd.h paths.h regex.h sys/syslimits.h \
-  termios.h sys/poll.h syslog.h mntent.h net/ethernet.h])
+  termios.h sys/poll.h syslog.h mntent.h net/ethernet.h linux/magic.h])
 
 dnl Where are the XDR functions?
 dnl If portablexdr is installed, prefer that.
index 5f15a64502434a647f8226e8613ab2e6042f4ca9..a07bedce4a21e63ed89e4c0ecccb42fc32835898 100644 (file)
@@ -27,7 +27,9 @@
 #include <unistd.h>
 #include <fcntl.h>
 #ifdef __linux__
-# include <linux/magic.h>
+# if HAVE_LINUX_MAGIC_H
+#  include <linux/magic.h>
+# endif
 # include <sys/statfs.h>
 #endif
 #include "dirname.h"
@@ -416,6 +418,9 @@ virStorageFileGetMetadata(const char *path,
 
 #ifdef __linux__
 
+# ifndef NFS_SUPER_MAGIC
+#  define NFS_SUPER_MAGIC 0x6969
+# endif
 # ifndef OCFS2_SUPER_MAGIC
 #  define OCFS2_SUPER_MAGIC 0x7461636f
 # endif