summaryrefslogtreecommitdiffstats
path: root/bin/pax/cpio.c
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2006-11-27 22:17:11 +0000
committerru <ru@FreeBSD.org>2006-11-27 22:17:11 +0000
commit04681b9d6f6256d3d9c21f3ef80f8db669c1d656 (patch)
treeabbe44082e1f3ea44346f7ff42f15f71a25baa4e /bin/pax/cpio.c
parent5511a715239bf3cd4863ed234ff9d60a14a0f752 (diff)
downloadFreeBSD-src-04681b9d6f6256d3d9c21f3ef80f8db669c1d656.zip
FreeBSD-src-04681b9d6f6256d3d9c21f3ef80f8db669c1d656.tar.gz
Fix some of the alignment warnings on ARM.
Diffstat (limited to 'bin/pax/cpio.c')
-rw-r--r--bin/pax/cpio.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/bin/pax/cpio.c b/bin/pax/cpio.c
index 1909f8e..67602fa 100644
--- a/bin/pax/cpio.c
+++ b/bin/pax/cpio.c
@@ -390,7 +390,7 @@ cpio_wr(ARCHD *arcn)
{
HD_CPIO *hd;
int nsz;
- char hdblk[sizeof(HD_CPIO)];
+ HD_CPIO hdblk;
/*
* check and repair truncated device and inode fields in the header
@@ -400,7 +400,7 @@ cpio_wr(ARCHD *arcn)
arcn->pad = 0L;
nsz = arcn->nlen + 1;
- hd = (HD_CPIO *)hdblk;
+ hd = &hdblk;
if ((arcn->type != PAX_BLK) && (arcn->type != PAX_CHR))
arcn->sb.st_rdev = 0;
@@ -467,7 +467,7 @@ cpio_wr(ARCHD *arcn)
/*
* write the file name to the archive
*/
- if ((wr_rdbuf(hdblk, (int)sizeof(HD_CPIO)) < 0) ||
+ if ((wr_rdbuf((char *)&hdblk, (int)sizeof(HD_CPIO)) < 0) ||
(wr_rdbuf(arcn->name, nsz) < 0)) {
paxwarn(1, "Unable to write cpio header for %s", arcn->org_name);
return(-1);
@@ -701,7 +701,7 @@ vcpio_wr(ARCHD *arcn)
{
HD_VCPIO *hd;
unsigned int nsz;
- char hdblk[sizeof(HD_VCPIO)];
+ HD_VCPIO hdblk;
/*
* check and repair truncated device and inode fields in the cpio
@@ -710,7 +710,7 @@ vcpio_wr(ARCHD *arcn)
if (map_dev(arcn, (u_long)VCPIO_MASK, (u_long)VCPIO_MASK) < 0)
return(-1);
nsz = arcn->nlen + 1;
- hd = (HD_VCPIO *)hdblk;
+ hd = &hdblk;
if ((arcn->type != PAX_BLK) && (arcn->type != PAX_CHR))
arcn->sb.st_rdev = 0;
@@ -802,7 +802,7 @@ vcpio_wr(ARCHD *arcn)
/*
* write the header, the file name and padding as required.
*/
- if ((wr_rdbuf(hdblk, (int)sizeof(HD_VCPIO)) < 0) ||
+ if ((wr_rdbuf((char *)&hdblk, (int)sizeof(HD_VCPIO)) < 0) ||
(wr_rdbuf(arcn->name, (int)nsz) < 0) ||
(wr_skip((off_t)(VCPIO_PAD(sizeof(HD_VCPIO) + nsz))) < 0)) {
paxwarn(1,"Could not write sv4cpio header for %s",arcn->org_name);
@@ -1001,7 +1001,7 @@ bcpio_wr(ARCHD *arcn)
{
HD_BCPIO *hd;
int nsz;
- char hdblk[sizeof(HD_BCPIO)];
+ HD_BCPIO hdblk;
off_t t_offt;
int t_int;
time_t t_timet;
@@ -1015,7 +1015,7 @@ bcpio_wr(ARCHD *arcn)
if ((arcn->type != PAX_BLK) && (arcn->type != PAX_CHR))
arcn->sb.st_rdev = 0;
- hd = (HD_BCPIO *)hdblk;
+ hd = &hdblk;
switch(arcn->type) {
case PAX_CTG:
@@ -1115,7 +1115,7 @@ bcpio_wr(ARCHD *arcn)
/*
* write the header, the file name and padding as required.
*/
- if ((wr_rdbuf(hdblk, (int)sizeof(HD_BCPIO)) < 0) ||
+ if ((wr_rdbuf((char *)&hdblk, (int)sizeof(HD_BCPIO)) < 0) ||
(wr_rdbuf(arcn->name, nsz) < 0) ||
(wr_skip((off_t)(BCPIO_PAD(sizeof(HD_BCPIO) + nsz))) < 0)) {
paxwarn(1, "Could not write bcpio header for %s", arcn->org_name);
OpenPOWER on IntegriCloud