2005-06-06 13:25:29 +00:00
|
|
|
--- mc-4.6.1a/src/mountlist.c.64bit 2005-02-08 23:33:52.000000000 +0100
|
|
|
|
+++ mc-4.6.1a/src/mountlist.c 2005-05-10 17:09:24.122853504 +0200
|
|
|
|
@@ -131,11 +131,19 @@ struct mount_entry
|
2005-04-04 07:29:29 +00:00
|
|
|
|
|
|
|
struct fs_usage
|
|
|
|
{
|
|
|
|
+#ifndef HAVE_SYS_STATVFS_H
|
|
|
|
long fsu_blocks; /* Total blocks. */
|
|
|
|
long fsu_bfree; /* Free blocks available to superuser. */
|
|
|
|
long fsu_bavail; /* Free blocks available to non-superuser. */
|
|
|
|
long fsu_files; /* Total file nodes. */
|
|
|
|
long fsu_ffree; /* Free file nodes. */
|
|
|
|
+#else /* We have sys/statvfs.h, use proper data types when _FILE_OFFSET_BITS=64 */
|
|
|
|
+ fsblkcnt_t fsu_blocks;
|
|
|
|
+ fsblkcnt_t fsu_bfree;
|
|
|
|
+ fsblkcnt_t fsu_bavail;
|
|
|
|
+ fsblkcnt_t fsu_files;
|
|
|
|
+ fsblkcnt_t fsu_ffree;
|
|
|
|
+#endif /* HAVE_SYS_STATVFS_H */
|
|
|
|
};
|
|
|
|
|
|
|
|
static int get_fs_usage (char *path, struct fs_usage *fsp);
|
2005-06-06 13:25:29 +00:00
|
|
|
@@ -665,6 +673,7 @@ my_statfs (struct my_statfs *myfs_stats,
|
2005-04-04 07:29:29 +00:00
|
|
|
BLOCKS FROMSIZE-byte blocks, rounding away from zero.
|
|
|
|
TOSIZE must be positive. Return -1 if FROMSIZE is not positive. */
|
|
|
|
|
|
|
|
+#if !defined(HAVE_SYS_STATFS_H) || !defined(STAT_STATVFS)
|
|
|
|
static long
|
|
|
|
fs_adjust_blocks (long blocks, int fromsize, int tosize)
|
|
|
|
{
|
2005-06-06 13:25:29 +00:00
|
|
|
@@ -672,13 +681,21 @@ fs_adjust_blocks (long blocks, int froms
|
2005-04-04 07:29:29 +00:00
|
|
|
abort ();
|
|
|
|
if (fromsize <= 0)
|
|
|
|
return -1;
|
|
|
|
-
|
|
|
|
+#else
|
|
|
|
+static fsblkcnt_t
|
|
|
|
+fs_adjust_blocks (fsblkcnt_t blocks, unsigned long fromsize, unsigned long tosize)
|
|
|
|
+{
|
|
|
|
+ if (!tosize)
|
|
|
|
+ abort ();
|
|
|
|
+ if (!fromsize)
|
|
|
|
+ return -1;
|
|
|
|
+#endif
|
|
|
|
if (fromsize == tosize) /* E.g., from 512 to 512. */
|
|
|
|
return blocks;
|
|
|
|
else if (fromsize > tosize) /* E.g., from 2048 to 512. */
|
|
|
|
return blocks * (fromsize / tosize);
|
|
|
|
else /* E.g., from 256 to 512. */
|
|
|
|
- return (blocks + (blocks < 0 ? -1 : 1)) / (tosize / fromsize);
|
|
|
|
+ return (blocks + 1) / (tosize / fromsize);
|
|
|
|
}
|
|
|
|
|
|
|
|
#if defined(_AIX) && defined(_I386)
|