2013-09-16 13:38:54 +00:00
|
|
|
diff --git a/src/util/fsspace.c b/src/util/fsspace.c
|
|
|
|
index 50a4aa7..beef3db 100644
|
|
|
|
--- a/src/util/fsspace.c
|
|
|
|
+++ b/src/util/fsspace.c
|
|
|
|
@@ -91,8 +91,15 @@ void fsspace(const char *path, struct fsspace * sp)
|
2005-04-20 15:28:22 +00:00
|
|
|
|
|
|
|
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",
|
2013-09-16 13:38:54 +00:00
|
|
|
diff --git a/src/util/sys_defs.h b/src/util/sys_defs.h
|
2022-02-22 14:13:26 +00:00
|
|
|
index c9ebc33..f2be0e2 100644
|
2013-09-16 13:38:54 +00:00
|
|
|
--- a/src/util/sys_defs.h
|
|
|
|
+++ b/src/util/sys_defs.h
|
2022-02-22 14:13:26 +00:00
|
|
|
@@ -771,8 +771,8 @@ extern int initgroups(const char *, int);
|
2013-09-16 13:38:54 +00:00
|
|
|
#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
|
2015-03-05 17:18:50 +00:00
|
|
|
#define HAS_DLOPEN
|