postfix/postfix-large-fs.patch
Miroslav Lichvar 47efd56ae6 - enable Large file support on 32-bit archs (#428996)
- fix mailq(1) and newaliases(1) man pages (#429501)
- move pflogsumm and qshape to -perl-scripts subpackage (#467529)
- update pflogsumm to 1.1.1
- fix large-fs patch
- drop open_define patch
- add -Wno-comment to CFLAGS
2008-11-20 14:06:08 +00:00

36 lines
1.5 KiB
Diff

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