[Glibc-bsd-commits] r1567 - in trunk/glibc-2.3-head/sysdeps/kfreebsd: . bits

Petr Salinger ps-guest at costa.debian.org
Fri May 12 16:31:05 UTC 2006


Author: ps-guest
Date: 2006-05-12 16:31:04 +0000 (Fri, 12 May 2006)
New Revision: 1567

Modified:
   trunk/glibc-2.3-head/sysdeps/kfreebsd/bits/statvfs.h
   trunk/glibc-2.3-head/sysdeps/kfreebsd/statfsconv.c
Log:
* fix type of f_fsid in struct statvfs, "detected" by mono  
  it have to be "unsigned long" according to POSIX
  workaround similar as in Linux


Modified: trunk/glibc-2.3-head/sysdeps/kfreebsd/bits/statvfs.h
===================================================================
--- trunk/glibc-2.3-head/sysdeps/kfreebsd/bits/statvfs.h	2006-05-11 19:29:41 UTC (rev 1566)
+++ trunk/glibc-2.3-head/sysdeps/kfreebsd/bits/statvfs.h	2006-05-12 16:31:04 UTC (rev 1567)
@@ -23,6 +23,10 @@
 
 #include <bits/types.h>
 
+#if __WORDSIZE == 32
+#define _STATVFSBUF_F_UNUSED
+#endif
+
 struct statvfs
   {
     unsigned long int f_bsize;
@@ -42,7 +46,10 @@
     __fsfilcnt64_t f_ffree;
     __fsfilcnt64_t f_favail;
 #endif
-    __fsid_t f_fsid;
+    unsigned long int f_fsid;
+#ifdef _STATVFSBUF_F_UNUSED
+    int __f_unused;
+#endif
     unsigned long int f_flag;
     unsigned long int f_namemax;
     unsigned int f_spare[6];
@@ -59,7 +66,10 @@
     __fsfilcnt64_t f_files;
     __fsfilcnt64_t f_ffree;
     __fsfilcnt64_t f_favail;
-    __fsid_t f_fsid;
+    unsigned long int f_fsid;
+#ifdef _STATVFSBUF_F_UNUSED
+    int __f_unused;
+#endif
     unsigned long int f_flag;
     unsigned long int f_namemax;
     unsigned int f_spare[6];

Modified: trunk/glibc-2.3-head/sysdeps/kfreebsd/statfsconv.c
===================================================================
--- trunk/glibc-2.3-head/sysdeps/kfreebsd/statfsconv.c	2006-05-11 19:29:41 UTC (rev 1566)
+++ trunk/glibc-2.3-head/sysdeps/kfreebsd/statfsconv.c	2006-05-12 16:31:04 UTC (rev 1567)
@@ -157,7 +157,8 @@
   p32->f_ffree		= MIN(pk->f_ffree,  ULONG_MAX);
   p32->f_favail		= MIN(pk->f_ffree,  ULONG_MAX); /* Hmm.	 May be filesystem dependent.  */
   
-  p32->f_fsid		= pk->f_fsid;
+  memcpy(&(p32->f_fsid), &(pk->f_fsid), sizeof(__fsid_t));
+  
   p32->f_flag		=
       (pk->f_flags & MNT_RDONLY ? ST_RDONLY : 0)
     | (pk->f_flags & MNT_NOSUID ? ST_NOSUID : 0)
@@ -188,7 +189,8 @@
   p64->f_ffree		= pk->f_ffree;
   p64->f_favail		= pk->f_ffree; /* Hmm.	May be filesystem dependent.  */
   
-  p64->f_fsid		= pk->f_fsid;
+  memcpy(&(p64->f_fsid), &(pk->f_fsid), sizeof(__fsid_t));
+  
   p64->f_flag		=
       (pk->f_flags & MNT_RDONLY ? ST_RDONLY : 0)
     | (pk->f_flags & MNT_NOSUID ? ST_NOSUID : 0)




More information about the Glibc-bsd-commits mailing list