From e4bd52d3c98bfeeb60c7ecfe5c9236655c14461c Mon Sep 17 00:00:00 2001 From: phk Date: Tue, 5 Dec 2006 09:41:16 +0000 Subject: [PATCH] Make the statfs(3)/statvfs(3) dictomy actually work. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1228 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- varnish-cache/bin/varnishd/storage_file.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/varnish-cache/bin/varnishd/storage_file.c b/varnish-cache/bin/varnishd/storage_file.c index fc959f7b..3209f7da 100644 --- a/varnish-cache/bin/varnishd/storage_file.c +++ b/varnish-cache/bin/varnishd/storage_file.c @@ -39,7 +39,6 @@ #ifdef HAVE_SYS_STATVFS_H #include -#define statfs statvfs #endif #ifdef HAVE_SYS_VFS_H @@ -122,11 +121,20 @@ smf_calcsize(struct smf_sc *sc, const char *size, int newfile) char suff[2]; int i, expl; off_t o; - struct statfs fsst; struct stat st; + AN(sc != NULL); AZ(fstat(sc->fd, &st)); + +#ifdef HAVE_SYS_STATVFS_H + struct statfs fsst; + AZ(fstatfs(sc->fd, &fsst)); +#endif + +#ifdef HAVE_SYS_VFS_H + struct statfs fsst; AZ(fstatfs(sc->fd, &fsst)); +#endif /* We use units of the larger of filesystem blocksize and pagesize */ bs = sc->pagesize; -- 2.39.5