summaryrefslogtreecommitdiffstats
path: root/bin/pax
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2010-02-07 17:05:22 +0000
committerimp <imp@FreeBSD.org>2010-02-07 17:05:22 +0000
commit6c40efb6971f00788aa6af3fe9837b5c29246925 (patch)
tree83cbcf76fd27414227cd426e16e953b0bc43e48f /bin/pax
parent760cf1fda368db2d149f89b1f413f19386474fb0 (diff)
downloadFreeBSD-src-6c40efb6971f00788aa6af3fe9837b5c29246925.zip
FreeBSD-src-6c40efb6971f00788aa6af3fe9837b5c29246925.tar.gz
Tell the compiler these structures are aligned to a byte boundary.
All the elements of these structs are char anyway, so it won't hurt performance. Bump warns back up to the default. # we likely should have CTASSERTS to make sure they are the right size. # but with libarchive based tar maybe we shouldn't bother.
Diffstat (limited to 'bin/pax')
-rw-r--r--bin/pax/Makefile2
-rw-r--r--bin/pax/cpio.h6
-rw-r--r--bin/pax/tar.h4
3 files changed, 5 insertions, 7 deletions
diff --git a/bin/pax/Makefile b/bin/pax/Makefile
index 77ef639..f142bfc 100644
--- a/bin/pax/Makefile
+++ b/bin/pax/Makefile
@@ -33,6 +33,4 @@ SRCS= ar_io.c ar_subs.c buf_subs.c cache.c cpio.c file_subs.c ftree.c \
#MAN= pax.1 tar.1 cpio.1
#LINKS= ${BINDIR}/pax ${BINDIR}/tar ${BINDIR}/pax ${BINDIR}/cpio
-WARNS?= 3
-
.include <bsd.prog.mk>
diff --git a/bin/pax/cpio.h b/bin/pax/cpio.h
index 2f4c37c..1cac0d7 100644
--- a/bin/pax/cpio.h
+++ b/bin/pax/cpio.h
@@ -67,7 +67,7 @@ typedef struct {
char c_mtime[11]; /* modification time */
char c_namesize[6]; /* length of pathname */
char c_filesize[11]; /* length of file in bytes */
-} HD_CPIO;
+} HD_CPIO __aligned(1);
#define MAGIC 070707 /* transportable archive id */
@@ -98,7 +98,7 @@ typedef struct {
u_char h_namesize[2];
u_char h_filesize_1[2];
u_char h_filesize_2[2];
-} HD_BCPIO;
+} HD_BCPIO __aligned(1);
#ifdef _PAX_
/*
@@ -136,7 +136,7 @@ typedef struct {
char c_rmin[8]; /* special file minor # */
char c_namesize[8]; /* length of pathname */
char c_chksum[8]; /* 0 OR CRC of bytes of FILE data */
-} HD_VCPIO;
+} HD_VCPIO __aligned(1);
#define VMAGIC 070701 /* sVr4 new portable archive id */
#define VCMAGIC 070702 /* sVr4 new portable archive id CRC */
diff --git a/bin/pax/tar.h b/bin/pax/tar.h
index 856e26c..df36360 100644
--- a/bin/pax/tar.h
+++ b/bin/pax/tar.h
@@ -96,7 +96,7 @@ typedef struct {
char chksum[CHK_LEN]; /* checksum */
char linkflag; /* norm, hard, or sym. */
char linkname[TNMSZ]; /* linked to name */
-} HD_TAR;
+} HD_TAR __aligned(1);
#ifdef _PAX_
/*
@@ -142,4 +142,4 @@ typedef struct {
char devmajor[8]; /* major device number */
char devminor[8]; /* minor device number */
char prefix[TPFSZ]; /* linked to name */
-} HD_USTAR;
+} HD_USTAR __aligned(1);
OpenPOWER on IntegriCloud