summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2011-03-27 02:12:21 +0000
committerChris Wilson <chris+github@qwirx.com>2011-03-27 02:12:21 +0000
commit15dfee03ad6424f60fa4c5a8a2873401777e7131 (patch)
tree895ad7a3be0dd16d359a212a8a60fc2befe6f2ac
parentaadd8c0c5ec686db303b7774974c91d52001dfec (diff)
Detect whether we have sys/file.h and don't include it if not, fixes MSVC compile issue.
-rw-r--r--configure.ac2
-rw-r--r--lib/raidfile/RaidFileWrite.cpp5
2 files changed, 5 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index 9f970d1f..610584d0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -132,7 +132,7 @@ AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS([dlfcn.h getopt.h process.h pwd.h signal.h])
AC_CHECK_HEADERS([syslog.h time.h cxxabi.h])
AC_CHECK_HEADERS([netinet/in.h])
-AC_CHECK_HEADERS([sys/param.h sys/socket.h sys/time.h sys/types.h sys/wait.h])
+AC_CHECK_HEADERS([sys/file.h sys/param.h sys/socket.h sys/time.h sys/types.h sys/wait.h])
AC_CHECK_HEADERS([sys/uio.h sys/xattr.h])
AC_CHECK_HEADERS([bsd/unistd.h])
diff --git a/lib/raidfile/RaidFileWrite.cpp b/lib/raidfile/RaidFileWrite.cpp
index 976d0bb4..504ac141 100644
--- a/lib/raidfile/RaidFileWrite.cpp
+++ b/lib/raidfile/RaidFileWrite.cpp
@@ -18,7 +18,10 @@
#include <sys/types.h>
#include <sys/stat.h>
-#include <sys/file.h>
+
+#ifdef HAVE_SYS_FILE_H
+# include <sys/file.h>
+#endif
#include <stdio.h>
#include <string.h>