From 194bbf149f46c19b868d29ef1beabba7804a49ef Mon Sep 17 00:00:00 2001 From: des Date: Thu, 1 Nov 2007 21:57:44 +0000 Subject: [PATCH] Fix the struct statvfs issue. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2226 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- varnish-cache/bin/varnishd/storage_file.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/varnish-cache/bin/varnishd/storage_file.c b/varnish-cache/bin/varnishd/storage_file.c index eb054f96..edbc38c6 100644 --- a/varnish-cache/bin/varnishd/storage_file.c +++ b/varnish-cache/bin/varnishd/storage_file.c @@ -33,7 +33,6 @@ #include #include -#include #include #include @@ -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; -- 2.39.5