r2226 - trunk/varnish-cache/bin/varnishd
des at projects.linpro.no
des at projects.linpro.no
Thu Nov 1 22:57:44 CET 2007
Author: des
Date: 2007-11-01 22:57:44 +0100 (Thu, 01 Nov 2007)
New Revision: 2226
Modified:
trunk/varnish-cache/bin/varnishd/storage_file.c
Log:
Fix the struct statvfs issue.
Modified: trunk/varnish-cache/bin/varnishd/storage_file.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/storage_file.c 2007-11-01 21:53:59 UTC (rev 2225)
+++ trunk/varnish-cache/bin/varnishd/storage_file.c 2007-11-01 21:57:44 UTC (rev 2226)
@@ -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 @@
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 @@
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;
More information about the varnish-commit
mailing list