From: Nathan Scott Date: Wed, 2 Apr 2003 23:52:41 +0000 (+0000) Subject: Minor tweaks to Russells FreeBSD changes in xfsprogs. X-Git-Tag: XFS-1_3_0pre1~26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1707056a8d6389c2f1f7162beb84e98cbbad2e37;p=thirdparty%2Fxfsprogs-dev.git Minor tweaks to Russells FreeBSD changes in xfsprogs. Add some text re Russells FreeBSD changes. --- diff --git a/doc/CHANGES b/doc/CHANGES index 4034eed48..fc7d69979 100644 --- a/doc/CHANGES +++ b/doc/CHANGES @@ -1,9 +1,10 @@ xfsprogs-2.4.4 (30 March 2003) - Correct display of imaxpct in mkfs.xfs output. - Portability changes; including some code to support use - of several tools on Mac OS X (for Russell), also did a - simplistic backport to IRIX (for me), so that I can run - purify on some of the tools. + of several tools on Mac OS X (for Russell), ditto for + FreeBSD (from Russell); also did a simplistic backport + to IRIX (for me), so that I can run purify on some of + the tools. - See doc/INSTALL for more details on this. - Sync up user/kernel source in libxfs and headers. - Fix up some warnings when compiling libxfs on big endian diff --git a/doc/INSTALL b/doc/INSTALL index 2ef911d86..2ecbf6ced 100644 --- a/doc/INSTALL +++ b/doc/INSTALL @@ -128,6 +128,7 @@ IRIX Instructions Building xfsprogs: [firstly set these environment variables to these values] + INSTALL_GROUP=sys CC=/usr/freeware/bin/gcc TAR=/usr/freeware/bin/tar MAKE=/usr/freeware/bin/gmake @@ -135,8 +136,6 @@ IRIX Instructions MSGFMT=/usr/freeware/bin/msgfmt MSGMERGE=/usr/freeware/bin/msgmerge XGETTEXT=/usr/freeware/bin/xgettext - INSTALL_GROUP=sys - LOCAL_CONFIGURE_OPTIONS="--enable-gettext=no" $ make $ su root diff --git a/include/builddefs.in b/include/builddefs.in index 95792e1bd..b939c8c4c 100644 --- a/include/builddefs.in +++ b/include/builddefs.in @@ -105,7 +105,7 @@ PLDLIBS = -ldisk -lgen endif ifeq ($(PKG_PLATFORM),freebsd) PLDLIBS = -L/usr/local/lib -lintl -CFLAGS += -I/usr/local/include +PCFLAGS = -I/usr/local/include endif GCFLAGS += $(OPTIMIZER) $(DEBUG) -funsigned-char -Wall -I$(TOPDIR)/include \ diff --git a/include/platform_defs.h.in b/include/platform_defs.h.in index 532753ebf..f686f97a3 100644 --- a/include/platform_defs.h.in +++ b/include/platform_defs.h.in @@ -46,6 +46,7 @@ #include #include + #if defined(__linux__) #include @@ -104,13 +105,16 @@ typedef unsigned char uchar_t; #endif typedef enum { B_FALSE,B_TRUE } boolean_t; + #elif defined(__FreeBSD__) + #include #include #include #include #include #include + /* FreeBSD file API is 64-bit aware */ #define fstat64 fstat #define ftruncate64 ftruncate @@ -139,13 +143,15 @@ typedef __uint32_t xfs_dev_t; typedef __int64_t xfs_daddr_t; typedef char* xfs_caddr_t; - #ifndef _UCHAR_T_DEFINED typedef unsigned char uchar_t; #define _UCHAR_T_DEFINED 1 #endif typedef enum { B_FALSE,B_TRUE } boolean_t; + #define HAVE_FID 1 +#define HAVE_SWABMACROS 1 + #elif defined(__APPLE__) /* Darwin */ diff --git a/include/xfs_arch.h b/include/xfs_arch.h index 164510175..eb09e7a99 100644 --- a/include/xfs_arch.h +++ b/include/xfs_arch.h @@ -41,10 +41,10 @@ #include #ifdef __LITTLE_ENDIAN -# define __BYTE_ORDER __LITTLE_ENDIAN +#define __BYTE_ORDER __LITTLE_ENDIAN #endif #ifdef __BIG_ENDIAN -# define __BYTE_ORDER __BIG_ENDIAN +#define __BYTE_ORDER __BIG_ENDIAN #endif #endif /* __KERNEL__ */ @@ -60,7 +60,7 @@ /* generic swapping macros */ -#if defined(__linux__) +#ifndef HAVE_SWABMACROS #define INT_SWAP16(type,var) ((typeof(type))(__swab16((__u16)(var)))) #define INT_SWAP32(type,var) ((typeof(type))(__swab32((__u32)(var)))) #define INT_SWAP64(type,var) ((typeof(type))(__swab64((__u64)(var)))) diff --git a/libxfs/Makefile b/libxfs/Makefile index 72f11c933..efbe4981f 100644 --- a/libxfs/Makefile +++ b/libxfs/Makefile @@ -48,7 +48,7 @@ CFILES = bit.c init.c logitem.c rdwr.c trans.c util.c \ xfs_mount.c xfs_trans.c CFILES += $(PKG_PLATFORM).c -PCFILES = darwin.c irix.c linux.c +PCFILES = darwin.c freebsd.c irix.c linux.c LSRCFILES = $(shell echo $(PCFILES) | sed -e "s/$(PKG_PLATFORM).c//g") # diff --git a/libxfs/freebsd.c b/libxfs/freebsd.c index c6e1efa63..ecb81f190 100644 --- a/libxfs/freebsd.c +++ b/libxfs/freebsd.c @@ -116,7 +116,7 @@ getdisksize(int fd, const char *fname) part = *s2++ - 'a'; } if (!s2 || (*s2 && *s2 != '.')) { - fprintf(stderr, "%s: can't figure out partition info\n", + fprintf(stderr, _("%s: can't figure out partition info\n"), progname); exit(1); } @@ -140,7 +140,7 @@ getdisksize(int fd, const char *fname) errno = e; } if (i == -1) { - fprintf(stderr, "%s: can't read disk label: %s\n", + fprintf(stderr, _("%s: can't read disk label: %s\n"), progname, strerror(errno)); exit(1); } @@ -149,8 +149,9 @@ getdisksize(int fd, const char *fname) part = RAW_PART; if (part >= lp->d_npartitions || !lp->d_partitions[part].p_size) { - fprintf(stderr, "%s: partition %s is unavailable\n", - progname, fname); + fprintf(stderr, + _("%s: partition %s is unavailable\n"), + progname, fname); exit(1); } size = lp->d_partitions[part].p_size; @@ -170,8 +171,8 @@ platform_findsize(char *path) * block device, if we are just use the size returned by stat64 */ if (stat(path, &st) < 0) { - fprintf(stderr, "%s: " - "cannot stat the device special file \"%s\": %s\n", + fprintf(stderr, _("%s: " + "cannot stat the device special file \"%s\": %s\n"), progname, path, strerror(errno)); exit(1); } @@ -180,8 +181,8 @@ platform_findsize(char *path) } if ((fd = open(path, 0)) < 0) { - fprintf(stderr, "%s: " - "error opening the device special file \"%s\": %s\n", + fprintf(stderr, _("%s: " + "error opening the device special file \"%s\": %s\n"), progname, path, strerror(errno)); exit(1); } diff --git a/po/Makefile b/po/Makefile index e733186cc..bc1505777 100644 --- a/po/Makefile +++ b/po/Makefile @@ -62,6 +62,7 @@ XGETTEXTFILES = \ $(TOPDIR)/libdisk/lvm.c \ $(TOPDIR)/libdisk/md.c \ $(TOPDIR)/libxfs/darwin.c \ + $(TOPDIR)/libxfs/freebsd.c \ $(TOPDIR)/libxfs/init.c \ $(TOPDIR)/libxfs/irix.c \ $(TOPDIR)/libxfs/linux.c \ diff --git a/po/xfsprogs.pot b/po/xfsprogs.pot index a235724c1..ecafc8e5a 100644 --- a/po/xfsprogs.pot +++ b/po/xfsprogs.pot @@ -1218,6 +1218,22 @@ msgstr "" msgid "%s: can't determine device size: %s\n" msgstr "" +#, c-format +msgid "%s: can't figure out partition info\n" +msgstr "" + +#, c-format +msgid "%s: can't read disk label: %s\n" +msgstr "" + +#, c-format +msgid "%s: partition %s is unavailable\n" +msgstr "" + +#, c-format +msgid "%s: cannot stat the device special file \"%s\": %s\n" +msgstr "" + #, c-format msgid "%s: %s: device %lld is not open\n" msgstr ""