From 0641f0f72c17c8ddc54cc2424aebc1929d01c01a Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Mon, 17 May 2010 16:17:08 +0200 Subject: [PATCH] build: avoid compile failure on linux kernels older than 2.6.19 * configure.ac: Check for . * src/util/storage_file.c: Include only if present. Linux kernels prior to 2.6.19 lacked it. [__linux__] (NFS_SUPER_MAGIC): Define if not already defined. --- configure.ac | 2 +- src/util/storage_file.c | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index c187420739..ebd208240e 100644 --- a/configure.ac +++ b/configure.ac @@ -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. diff --git a/src/util/storage_file.c b/src/util/storage_file.c index 5f15a64502..a07bedce4a 100644 --- a/src/util/storage_file.c +++ b/src/util/storage_file.c @@ -27,7 +27,9 @@ #include #include #ifdef __linux__ -# include +# if HAVE_LINUX_MAGIC_H +# include +# endif # include #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