Mailing List Archive

r1228 - trunk/varnish-cache/bin/varnishd
Author: phk
Date: 2006-12-05 10:41:16 +0100 (Tue, 05 Dec 2006)
New Revision: 1228

Modified:
trunk/varnish-cache/bin/varnishd/storage_file.c
Log:
Make the statfs(3)/statvfs(3) dictomy actually work.


Modified: trunk/varnish-cache/bin/varnishd/storage_file.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/storage_file.c 2006-12-05 08:48:27 UTC (rev 1227)
+++ trunk/varnish-cache/bin/varnishd/storage_file.c 2006-12-05 09:41:16 UTC (rev 1228)
@@ -39,7 +39,6 @@

#ifdef HAVE_SYS_STATVFS_H
#include <sys/statvfs.h>
-#define statfs statvfs
#endif

#ifdef HAVE_SYS_VFS_H
@@ -122,12 +121,21 @@
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;
if (bs < fsst.f_bsize)