]> err.no Git - varnish/commitdiff
Fix the struct statvfs issue.
authordes <des@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Thu, 1 Nov 2007 21:57:44 +0000 (21:57 +0000)
committerdes <des@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Thu, 1 Nov 2007 21:57:44 +0000 (21:57 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2226 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/storage_file.c

index eb054f96aebb11bf8957d9d0211c1c77b163ce14..edbc38c60d390b7f19690ac52248e66e35ddb028 100644 (file)
@@ -33,7 +33,6 @@
 
 #include <sys/param.h>
 #include <sys/mman.h>
-#include <sys/mount.h>
 #include <sys/socket.h>
 #include <sys/stat.h>
 
@@ -122,7 +121,13 @@ struct smf_sc {
 static void
 smf_calcsize(struct smf_sc *sc, const char *size, int newfile)
 {
+#if defined(HAVE_SYS_STATVFS_H)
+       struct statvfs fsst;
+#elif defined(HAVE_SYS_MOUNT_H) || defined(HAVE_SYS_VFS_H)
        struct statfs fsst;
+#else
+#error no struct statfs / struct statvfs
+#endif
        uintmax_t l, fssize;
        unsigned bs;
        char suff[2];
@@ -134,7 +139,13 @@ smf_calcsize(struct smf_sc *sc, const char *size, int newfile)
        AZ(fstat(sc->fd, &st));
        xxxassert(S_ISREG(st.st_mode));
 
+#if defined(HAVE_SYS_STATVFS_H)
+       AZ(fstatvfs(sc->fd, &fsst));
+#elif defined(HAVE_SYS_MOUNT_H) || defined(HAVE_SYS_VFS_H)
        AZ(fstatfs(sc->fd, &fsst));
+#else
+#error no struct statfs / struct statvfs
+#endif
 
        /* We use units of the larger of filesystem blocksize and pagesize */
        bs = sc->pagesize;