postfix-large-fs.patch 1.5 KB

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