STAT_STATVFS patch

Pavel Vasilyev pavel at pavlinux.ru
Thu Jan 8 02:41:11 UTC 2009


[PATCH]
# This patch replaced STAT_STATVFS  which not defined
# nowhere, noone, library, standart or other rules!!!
# Replaced by HAVE_SYS_STATVFS_H which defined in <sys/statvfs.h>
#
# This patch replaced STAT_STATVFS  which not defined
# nowhere, noone, library, standart or other rules!!!
# Replaced by HAVE_SYS_STATVFS_H which defined in <sys/statvfs.h>
#
Index: mc/src/fsusage.c
--- mc/src/fsusage.c Base (1.14)
+++ mc/src/fsusage.c Locally Modified (Based On 1.14)
@@ -26,7 +26,7 @@
 #include <limits.h>
 #include <sys/types.h>

-#if STAT_STATVFS               /* POSIX 1003.1-2001 (and later) with XSI */
+#if HAVE_SYS_STATVFS_H         /* POSIX 1003.1-2001 (and later) with XSI */
 # include <sys/statvfs.h>
 #else
 /* Don't include backward-compatibility files unless they're needed.
@@ -91,7 +91,7 @@
    on a system that requires a non-NULL value.  */
 int get_fs_usage (char const *file, char const *disk, struct fs_usage *fsp)
 {
-#if defined STAT_STATVFS               /* POSIX */
+#if defined HAVE_SYS_STATVFS_H         /* POSIX */

   struct statvfs fsd;

@@ -217,7 +217,7 @@

 #endif

-#if (defined STAT_STATVFS \
+#if (defined HAVE_SYS_STATVFS_H \
      || (!defined STAT_STATFS2_FS_DATA && !defined STAT_READ_FILSYS))
     fsp->fsu_blocks = PROPAGATE_ALL_ONES (fsd.f_blocks);
Index: mc/src/mountlist.c
--- mc/src/mountlist.c Base (1.32)
+++ mc/src/mountlist.c Locally Modified (Based On 1.32)
@@ -825,7 +825,8 @@
     fsp->fsu_ffree = fsd.fd_req.gfree;
 #endif

-#ifdef STAT_STATFS2_BSIZE      /* 4.3BSD, SunOS 4, HP-UX, AIX.  */
+
+#if defined (STAT_STATFS2_BSIZE) && !defined(HAVE_SYS_STATVFS_H) /* 4.3BSD, 
SunOS 4, HP-UX, AIX.  */
     struct statfs fsd;

     if (statfs (path, &fsd) < 0)
@@ -841,7 +842,7 @@
 #define CONVERT_BLOCKS(b) fs_adjust_blocks ((b), fsd.f_fsize, 512)
 #endif

-#ifdef STAT_STATFS4            /* SVR3, Dynix, Irix, AIX.  */
+#if defined (STAT_STATFS4) && !defined(HAVE_SYS_STATVFS_H) /* SVR3, Dynix, 
Irix, AIX.  */
     struct statfs fsd;

     if (statfs (path, &fsd, sizeof fsd, 0) < 0)
@@ -861,7 +862,7 @@
 #endif
 #endif

-#ifdef STAT_STATVFS            /* SVR4.  */
+#ifdef HAVE_SYS_STATVFS_H              /* SVR4.  */
     struct statvfs fsd;

     if (statvfs (path, &fsd) < 0)
Index: mc/vfs/samba/include/includes.h
--- mc/vfs/samba/include/includes.h Base (1.14)
+++ mc/vfs/samba/include/includes.h Locally Modified (Based On 1.14)
@@ -565,7 +565,7 @@
 #endif

 /* this guess needs to be improved (tridge) */
-#if (defined(STAT_STATVFS) || defined(STAT_STATVFS64)) && !defined(SYSV)
+#if (defined(HAVE_SYS_STATVFS_H) || defined(HAVE_SYS_STATVFS_H64)) 
&& !defined(SYSV)
 #define SYSV 1
 #endif

--- ChangeLog   2009-01-08 05:36:49.726110166 +0300
+++ ChangeLog   2009-01-08 05:36:24.000000000 +0300
@@ -1,3 +1,8 @@
+2009-01-09  Pavel Vasilyev <pavel at pavlinux.ru>
+       * src/mountlist.c: replace STAT_STATVFS HAVE_SYS_STATVFS_H
+       * src/fsusage.c:   replace STAT_STATVFS HAVE_SYS_STATVFS_H
+       * vfs/samba/include/includes.h: replace STAT_STATVFS 
HAVE_SYS_STATVFS_H
+
 2008-12-18  Roland Illig  <roland.illig at gmx.de>

        * doc/mcedit.1: Documented the newly added filename:lineno
# [ EOF PATCH]
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mc-cvs-2009-08-01-stat_statvfs.patch
Type: text/x-diff
Size: 2882 bytes
Desc: not available
URL: <http://lists.midnight-commander.org/pipermail/mc/attachments/20090108/f96730bc/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 194 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.midnight-commander.org/pipermail/mc/attachments/20090108/f96730bc/attachment.asc>


More information about the mc mailing list