Blame SOURCES/postfix-large-fs.patch

4c1099
diff -up postfix-2.5.5/src/util/sys_defs.h.large-fs postfix-2.5.5/src/util/sys_defs.h
4c1099
--- postfix-2.5.5/src/util/sys_defs.h.large-fs	2008-01-15 01:51:44.000000000 +0100
4c1099
+++ postfix-2.5.5/src/util/sys_defs.h	2008-10-21 17:55:29.000000000 +0200
4c1099
@@ -709,8 +709,8 @@ extern int initgroups(const char *, int)
4c1099
 #define GETTIMEOFDAY(t)	gettimeofday(t,(struct timezone *) 0)
4c1099
 #define ROOT_PATH	"/bin:/usr/bin:/sbin:/usr/sbin"
4c1099
 #define FIONREAD_IN_TERMIOS_H
4c1099
-#define USE_STATFS
4c1099
-#define STATFS_IN_SYS_VFS_H
4c1099
+#define USE_STATVFS
4c1099
+#define STATVFS_IN_SYS_STATVFS_H
4c1099
 #define PREPEND_PLUS_TO_OPTSTRING
4c1099
 #define HAS_POSIX_REGEXP
4c1099
 #define NATIVE_SENDMAIL_PATH "/usr/sbin/sendmail"
4c1099
diff -up postfix-2.5.5/src/util/fsspace.c.large-fs postfix-2.5.5/src/util/fsspace.c
4c1099
--- postfix-2.5.5/src/util/fsspace.c.large-fs	2006-06-15 20:07:16.000000000 +0200
4c1099
+++ postfix-2.5.5/src/util/fsspace.c	2008-10-21 17:56:29.000000000 +0200
4c1099
@@ -91,8 +91,15 @@ void    fsspace(const char *path, struct
4c1099
 
4c1099
     if (statvfs(path, &fsbuf) < 0)
4c1099
 	msg_fatal("statvfs %s: %m", path);
4c1099
-    sp->block_size = fsbuf.f_frsize;
4c1099
-    sp->block_free = fsbuf.f_bavail;
4c1099
+    if (fsbuf.f_frsize > 0)
4c1099
+	sp->block_size = fsbuf.f_frsize;
4c1099
+    else
4c1099
+	sp->block_size = fsbuf.f_bsize;
4c1099
+    /* 4G of FS blocks is surely enough space to put a mail in */
4c1099
+    sp->block_free = 0;
4c1099
+    sp->block_free = ~sp->block_free;
4c1099
+    if (fsbuf.f_bavail < sp->block_free)
4c1099
+	sp->block_free = fsbuf.f_bavail;
4c1099
 #endif
4c1099
     if (msg_verbose)
4c1099
 	msg_info("%s: %s: block size %lu, blocks free %lu",