summaryrefslogtreecommitdiff
path: root/bin/pax/cpio.c
diff options
context:
space:
mode:
authorThorsten Lockert <tholo@cvs.openbsd.org>1996-06-11 06:41:56 +0000
committerThorsten Lockert <tholo@cvs.openbsd.org>1996-06-11 06:41:56 +0000
commit8a9719310ac5463126ef3eec984d2d38f58e851e (patch)
tree7eeb0f7c13108018057e83b9666bc315c747c21e /bin/pax/cpio.c
parent8db8a379747ee056c46b16e020c29c8a5829e357 (diff)
Correct compile warnings
Rename warn() to paxwarn() so <err.h> can be included Remove #include <ctype.h> when not needed; from FreeBSD
Diffstat (limited to 'bin/pax/cpio.c')
-rw-r--r--bin/pax/cpio.c37
1 files changed, 18 insertions, 19 deletions
diff --git a/bin/pax/cpio.c b/bin/pax/cpio.c
index df0885aecd5..44caa1595d0 100644
--- a/bin/pax/cpio.c
+++ b/bin/pax/cpio.c
@@ -50,7 +50,6 @@ static char rcsid[] = "$NetBSD: cpio.c,v 1.5 1995/03/21 09:07:13 cgd Exp $";
#include <sys/stat.h>
#include <sys/param.h>
#include <string.h>
-#include <ctype.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
@@ -221,7 +220,7 @@ rd_nm(arcn, nsz)
* do not even try bogus values
*/
if ((nsz == 0) || (nsz > sizeof(arcn->name))) {
- warn(1, "Cpio file name length %d is out of range", nsz);
+ paxwarn(1, "Cpio file name length %d is out of range", nsz);
return(-1);
}
@@ -230,7 +229,7 @@ rd_nm(arcn, nsz)
*/
if ((rd_wrbuf(arcn->name,nsz) != nsz) || (arcn->name[nsz-1] != '\0') ||
(arcn->name[0] == '\0')) {
- warn(1, "Cpio file name in header is corrupted");
+ paxwarn(1, "Cpio file name in header is corrupted");
return(-1);
}
return(0);
@@ -259,10 +258,10 @@ rd_ln_nm(arcn)
if ((arcn->sb.st_size == 0) ||
(arcn->sb.st_size >= sizeof(arcn->ln_name))) {
# ifdef NET2_STAT
- warn(1, "Cpio link name length is invalid: %lu",
+ paxwarn(1, "Cpio link name length is invalid: %lu",
arcn->sb.st_size);
# else
- warn(1, "Cpio link name length is invalid: %qu",
+ paxwarn(1, "Cpio link name length is invalid: %qu",
arcn->sb.st_size);
# endif
return(-1);
@@ -273,7 +272,7 @@ rd_ln_nm(arcn)
*/
if (rd_wrbuf(arcn->ln_name, (int)arcn->sb.st_size) !=
(int)arcn->sb.st_size) {
- warn(1, "Cpio link name read error");
+ paxwarn(1, "Cpio link name read error");
return(-1);
}
arcn->ln_nlen = arcn->sb.st_size;
@@ -283,7 +282,7 @@ rd_ln_nm(arcn)
* watch out for those empty link names
*/
if (arcn->ln_name[0] == '\0') {
- warn(1, "Cpio link name is corrupt");
+ paxwarn(1, "Cpio link name is corrupt");
return(-1);
}
return(0);
@@ -485,7 +484,7 @@ cpio_wr(arcn)
if (uqd_asc((u_quad_t)arcn->sb.st_size, hd->c_filesize,
sizeof(hd->c_filesize), OCT)) {
# endif
- warn(1,"File is too large for cpio format %s",
+ paxwarn(1,"File is too large for cpio format %s",
arcn->org_name);
return(1);
}
@@ -536,7 +535,7 @@ cpio_wr(arcn)
*/
if ((wr_rdbuf(hdblk, (int)sizeof(HD_CPIO)) < 0) ||
(wr_rdbuf(arcn->name, nsz) < 0)) {
- warn(1, "Unable to write cpio header for %s", arcn->org_name);
+ paxwarn(1, "Unable to write cpio header for %s", arcn->org_name);
return(-1);
}
@@ -555,7 +554,7 @@ cpio_wr(arcn)
* next file as we are done.
*/
if (wr_rdbuf(arcn->ln_name, arcn->ln_nlen) < 0) {
- warn(1,"Unable to write cpio link name for %s",arcn->org_name);
+ paxwarn(1,"Unable to write cpio link name for %s",arcn->org_name);
return(-1);
}
return(1);
@@ -564,7 +563,7 @@ cpio_wr(arcn)
/*
* header field is out of range
*/
- warn(1, "Cpio header field is too small to store file %s",
+ paxwarn(1, "Cpio header field is too small to store file %s",
arcn->org_name);
return(1);
}
@@ -852,7 +851,7 @@ vcpio_wr(arcn)
if (uqd_asc((u_quad_t)arcn->sb.st_size, hd->c_filesize,
sizeof(hd->c_filesize), HEX)) {
# endif
- warn(1,"File is too large for sv4cpio format %s",
+ paxwarn(1,"File is too large for sv4cpio format %s",
arcn->org_name);
return(1);
}
@@ -910,7 +909,7 @@ vcpio_wr(arcn)
if ((wr_rdbuf(hdblk, (int)sizeof(HD_VCPIO)) < 0) ||
(wr_rdbuf(arcn->name, (int)nsz) < 0) ||
(wr_skip((off_t)(VCPIO_PAD(sizeof(HD_VCPIO) + nsz))) < 0)) {
- warn(1,"Could not write sv4cpio header for %s",arcn->org_name);
+ paxwarn(1,"Could not write sv4cpio header for %s",arcn->org_name);
return(-1);
}
@@ -932,7 +931,7 @@ vcpio_wr(arcn)
*/
if ((wr_rdbuf(arcn->ln_name, arcn->ln_nlen) < 0) ||
(wr_skip((off_t)(VCPIO_PAD(arcn->ln_nlen))) < 0)) {
- warn(1,"Could not write sv4cpio link name for %s",
+ paxwarn(1,"Could not write sv4cpio link name for %s",
arcn->org_name);
return(-1);
}
@@ -942,7 +941,7 @@ vcpio_wr(arcn)
/*
* header field is out of range
*/
- warn(1,"Sv4cpio header field is too small for file %s",arcn->org_name);
+ paxwarn(1,"Sv4cpio header field is too small for file %s",arcn->org_name);
return(1);
}
@@ -1163,7 +1162,7 @@ bcpio_wr(arcn)
t_offt = (off_t)(SHRT_EXT(hd->h_filesize_1));
t_offt = (t_offt<<16) | ((off_t)(SHRT_EXT(hd->h_filesize_2)));
if (arcn->sb.st_size != t_offt) {
- warn(1,"File is too large for bcpio format %s",
+ paxwarn(1,"File is too large for bcpio format %s",
arcn->org_name);
return(1);
}
@@ -1248,7 +1247,7 @@ bcpio_wr(arcn)
if ((wr_rdbuf(hdblk, (int)sizeof(HD_BCPIO)) < 0) ||
(wr_rdbuf(arcn->name, nsz) < 0) ||
(wr_skip((off_t)(BCPIO_PAD(sizeof(HD_BCPIO) + nsz))) < 0)) {
- warn(1, "Could not write bcpio header for %s", arcn->org_name);
+ paxwarn(1, "Could not write bcpio header for %s", arcn->org_name);
return(-1);
}
@@ -1270,7 +1269,7 @@ bcpio_wr(arcn)
*/
if ((wr_rdbuf(arcn->ln_name, arcn->ln_nlen) < 0) ||
(wr_skip((off_t)(BCPIO_PAD(arcn->ln_nlen))) < 0)) {
- warn(1,"Could not write bcpio link name for %s",arcn->org_name);
+ paxwarn(1,"Could not write bcpio link name for %s",arcn->org_name);
return(-1);
}
return(1);
@@ -1279,6 +1278,6 @@ bcpio_wr(arcn)
/*
* header field is out of range
*/
- warn(1,"Bcpio header field is too small for file %s", arcn->org_name);
+ paxwarn(1,"Bcpio header field is too small for file %s", arcn->org_name);
return(1);
}