summaryrefslogtreecommitdiff
path: root/usr.sbin/mtree/spec.c
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1997-07-18 05:49:05 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1997-07-18 05:49:05 +0000
commit5cf4c19e580959337edd9b18ca93c1bc69d25b81 (patch)
treec9ce2399efd662a3ccbc5a0214da8aed2801c446 /usr.sbin/mtree/spec.c
parent746f76d401703e14909551c837fbeb052487791d (diff)
err() -> error() so we don't conflict with err(3).
Diffstat (limited to 'usr.sbin/mtree/spec.c')
-rw-r--r--usr.sbin/mtree/spec.c46
1 files changed, 23 insertions, 23 deletions
diff --git a/usr.sbin/mtree/spec.c b/usr.sbin/mtree/spec.c
index 463024fca92..d5e3655c5f5 100644
--- a/usr.sbin/mtree/spec.c
+++ b/usr.sbin/mtree/spec.c
@@ -1,5 +1,5 @@
/* $NetBSD: spec.c,v 1.6 1995/03/07 21:12:12 cgd Exp $ */
-/* $OpenBSD: spec.c,v 1.8 1997/07/18 05:46:14 millert Exp $ */
+/* $OpenBSD: spec.c,v 1.9 1997/07/18 05:49:04 millert Exp $ */
/*-
* Copyright (c) 1989, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)spec.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: spec.c,v 1.8 1997/07/18 05:46:14 millert Exp $";
+static char rcsid[] = "$OpenBSD: spec.c,v 1.9 1997/07/18 05:49:04 millert Exp $";
#endif
#endif /* not lint */
@@ -79,7 +79,7 @@ spec()
/* Find end of line. */
if ((p = strchr(buf, '\n')) == NULL)
- err("line %d too long", lineno);
+ error("line %d too long", lineno);
/* See if next line is continuation line. */
if (p[-1] == '\\') {
@@ -107,7 +107,7 @@ spec()
/* Grab file name, "$", "set", or "unset". */
if ((p = strtok(p, "\n\t ")) == NULL)
- err("missing field");
+ error("missing field");
if (p[0] == '/')
switch(p[1]) {
@@ -124,7 +124,7 @@ spec()
}
if (strchr(p, '/'))
- err("slash character in file name");
+ error("slash character in file name");
if (!strcmp(p, "..")) {
/* Don't go up, if haven't gone down. */
@@ -138,11 +138,11 @@ spec()
last->flags |= F_DONE;
continue;
-noparent: err("no parent node");
+noparent: error("no parent node");
}
if ((centry = calloc(1, sizeof(NODE) + strlen(p))) == NULL)
- err("%s", strerror(errno));
+ error("%s", strerror(errno));
*centry = ginfo;
(void)strcpy(centry->name, p);
#define MAGIC "?*["
@@ -181,26 +181,26 @@ set(t, ip)
for (; (kw = strtok(t, "= \t\n")); t = NULL) {
ip->flags |= type = parsekey(kw, &value);
if (value && (val = strtok(NULL, " \t\n")) == NULL)
- err("missing value");
+ error("missing value");
switch(type) {
case F_CKSUM:
ip->cksum = strtoul(val, &ep, 10);
if (*ep)
- err("invalid checksum %s", val);
+ error("invalid checksum %s", val);
break;
case F_MD5:
ip->md5digest = strdup(val);
if (!ip->md5digest)
- err("%s", strerror(errno));
+ error("%s", strerror(errno));
break;
case F_GID:
ip->st_gid = strtoul(val, &ep, 10);
if (*ep)
- err("invalid gid %s", val);
+ error("invalid gid %s", val);
break;
case F_GNAME:
if ((gr = getgrnam(val)) == NULL)
- err("unknown group %s", val);
+ error("unknown group %s", val);
ip->st_gid = gr->gr_gid;
break;
case F_IGN:
@@ -208,41 +208,41 @@ set(t, ip)
break;
case F_MODE:
if ((m = setmode(val)) == NULL)
- err("invalid file mode %s", val);
+ error("invalid file mode %s", val);
ip->st_mode = getmode(m, 0);
break;
case F_NLINK:
ip->st_nlink = strtoul(val, &ep, 10);
if (*ep)
- err("invalid link count %s", val);
+ error("invalid link count %s", val);
break;
case F_RMD160:
ip->rmd160digest = strdup(val);
if (!ip->rmd160digest)
- err("%s", strerror(errno));
+ error("%s", strerror(errno));
break;
case F_SHA1:
ip->sha1digest = strdup(val);
if (!ip->sha1digest)
- err("%s", strerror(errno));
+ error("%s", strerror(errno));
break;
case F_SIZE:
ip->st_size = strtouq(val, &ep, 10);
if (*ep)
- err("invalid size %s", val);
+ error("invalid size %s", val);
break;
case F_SLINK:
if ((ip->slink = strdup(val)) == NULL)
- err("%s", strerror(errno));
+ error("%s", strerror(errno));
break;
case F_TIME:
ip->st_mtimespec.tv_sec = strtoul(val, &ep, 10);
if (*ep != '.')
- err("invalid time %s", val);
+ error("invalid time %s", val);
val = ep + 1;
ip->st_mtimespec.tv_nsec = strtoul(val, &ep, 10);
if (*ep)
- err("invalid time %s", val);
+ error("invalid time %s", val);
break;
case F_TYPE:
switch(*val) {
@@ -273,17 +273,17 @@ set(t, ip)
ip->type = F_SOCK;
break;
default:
- err("unknown file type %s", val);
+ error("unknown file type %s", val);
}
break;
case F_UID:
ip->st_uid = strtoul(val, &ep, 10);
if (*ep)
- err("invalid uid %s", val);
+ error("invalid uid %s", val);
break;
case F_UNAME:
if ((pw = getpwnam(val)) == NULL)
- err("unknown user %s", val);
+ error("unknown user %s", val);
ip->st_uid = pw->pw_uid;
break;
}