On Fri, May 26, 2006 at 04:21:19PM -0400, Craig Rodrigues wrote:
> On Sat, May 27, 2006 at 05:25:34AM +1000, Nathan Scott wrote:
> > Russell mentioned there was an endianness issue in the current
> > Freebsd specific headers (iirc) - I don't have a patch though;
> > this is probably a symptom of that.
>
> Which headers should I be looking at?
Try the patch below, lemme know if it fixes things.
> 00000000 58 46 53 42 00 00 10 00 00 00 00 00 00 8b 3c 80 |XFSB..........<.|
...
> 00000000 42 53 46 58 00 10 00 00 80 3c 8b 00 00 00 00 00 |BSFX.....<......|
Heh.
--
Nathan
Index: xfsprogs/include/freebsd.h
===================================================================
--- xfsprogs.orig/include/freebsd.h 2006-04-28 10:09:16.000000000 +1000
+++ xfsprogs/include/freebsd.h 2006-05-27 08:08:52.451376664 +1000
@@ -28,6 +28,9 @@
#include <uuid.h>
#include <machine/endian.h>
+#define __BYTE_ORDER BYTE_ORDER
+#define __LITTLE_ENDIAN LITTLE_ENDIAN
+#define __BIG_ENDIAN BIG_ENDIAN
/* FreeBSD file API is 64-bit aware */
#define fstat64 fstat
@@ -75,7 +78,7 @@ static __inline__ int platform_test_xfs_
struct statfs buf;
if (fstatfs(fd, &buf) < 0)
return 0;
- return strcpy(buf.f_fstypename, "xfs") == 0;
+ return strncmp(buf.f_fstypename, "xfs", 4) == 0;
}
static __inline__ int platform_test_xfs_path(const char *path)
@@ -83,7 +86,7 @@ static __inline__ int platform_test_xfs_
struct statfs buf;
if (statfs(path, &buf) < 0)
return 0;
- return strcpy(buf.f_fstypename, "xfs") == 0;
+ return strncmp(buf.f_fstypename, "xfs", 4) == 0;
}
static __inline__ int platform_fstatfs(int fd, struct statfs *buf)
|