diff options
author | charnier <charnier@FreeBSD.org> | 1998-07-28 06:36:31 +0000 |
---|---|---|
committer | charnier <charnier@FreeBSD.org> | 1998-07-28 06:36:31 +0000 |
commit | cd64002d5da7c3bacf30747f3a6af5baca8676a6 (patch) | |
tree | 083e700ad435744b33aa1ed531c4da6bb11f49b8 /sbin/routed/parms.c | |
parent | 6999d30e2ecf654e56794fbef703e59c1826883a (diff) | |
download | FreeBSD-src-cd64002d5da7c3bacf30747f3a6af5baca8676a6.zip FreeBSD-src-cd64002d5da7c3bacf30747f3a6af5baca8676a6.tar.gz |
Spelling, add rcsid, remove unused #includes.
Convert 1000000 usec to 1 sec 0 usec.
Use provided safe malloc (rtmalloc()) instead of malloc(): exit on allocation
failure.
Correct use of .Nm
Add usage() and use errx().
Diffstat (limited to 'sbin/routed/parms.c')
-rw-r--r-- | sbin/routed/parms.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/sbin/routed/parms.c b/sbin/routed/parms.c index 287a82f..9e1cbce 100644 --- a/sbin/routed/parms.c +++ b/sbin/routed/parms.c @@ -31,18 +31,18 @@ * SUCH DAMAGE. */ -#if !defined(lint) && !defined(sgi) && !defined(__NetBSD__) +#ifndef lint +#if 0 static char sccsid[] = "@(#)if.c 8.1 (Berkeley) 6/5/93"; -#elif defined(__NetBSD__) -static char rcsid[] = "$NetBSD$"; #endif -#ident "$Revision: 1.2 $" +static const char rcsid[] = + "$Id$"; +#endif /* not lint */ #include "defs.h" #include "pathnames.h" #include <sys/stat.h> - struct parm *parms; struct intnet *intnets; struct tgate *tgates; @@ -311,7 +311,7 @@ gwkludge(void) continue; } - ifp = (struct interface *)malloc(sizeof(*ifp)); + ifp = (struct interface *)rtmalloc(sizeof(*ifp), "gwkludge"); bzero(ifp, sizeof(*ifp)); ifp->int_state = state; @@ -558,7 +558,8 @@ parse_parms(char *line, /* "subnet=x.y.z.u/mask,metric" must be alone on the line */ if (!strncasecmp(line, "subnet=", sizeof("subnet=")-1) && *(val = &line[sizeof("subnet=")-1]) != '\0') { - intnetp = (struct intnet*)malloc(sizeof(*intnetp)); + intnetp = (struct intnet*) + rtmalloc(sizeof(*intnetp), "parse_parms"); intnetp->intnet_metric = 1; if ((p = strrchr(val,','))) { *p++ = '\0'; @@ -715,7 +716,8 @@ parse_parms(char *line, } else if (PARSEQ("trust_gateway")) { if (!gethost(buf,&addr)) return tgt; - tg = (struct tgate *)malloc(sizeof(*tg)); + tg = (struct tgate *) + rtmalloc(sizeof(*tg), "parse_parms"); tg->tgate_next = tgates; tg->tgate_addr = addr; tgates = tg; @@ -802,7 +804,7 @@ check_parms(struct parm *new) /* link new entry on the so that when the entries are scanned, * they affect the result in the order the operator specified. */ - parmp = (struct parm*)malloc(sizeof(*parmp)); + parmp = (struct parm*)rtmalloc(sizeof(*parmp), "check_parms"); bcopy(new, parmp, sizeof(*parmp)); *parmpp = parmp; |