Index: freebsd.h =================================================================== RCS file: /cvs/xfs-cmds/xfsprogs/include/freebsd.h,v retrieving revision 1.5 diff -u -u -r1.5 freebsd.h --- freebsd.h 28 Apr 2006 04:02:55 -0000 1.5 +++ freebsd.h 27 May 2006 22:03:19 -0000 @@ -27,7 +27,13 @@ #include #include -#include +#include +#define __BYTE_ORDER BYTE_ORDER +#define __BIG_ENDIAN BIG_ENDIAN +#define __LITTLE_ENDIAN LITTLE_ENDIAN +#define __swab16(x) __bswap16(x) +#define __swab32(x) __bswap32(x) +#define __swab64(x) __bswap64(x) /* FreeBSD file API is 64-bit aware */ #define fstat64 fstat @@ -60,10 +66,6 @@ #define O_LARGEFILE 0 #define HAVE_FID 1 -#define HAVE_SWABMACROS 1 -#define INT_SWAP16(type,var) ((typeof(type))(__bswap16((__u16)(var)))) -#define INT_SWAP32(type,var) ((typeof(type))(__bswap32((__u32)(var)))) -#define INT_SWAP64(type,var) ((typeof(type))(__bswap64((__u64)(var)))) static __inline__ int xfsctl(const char *path, int fd, int cmd, void *p) { @@ -75,7 +77,7 @@ 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 +85,7 @@ 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)