summaryrefslogtreecommitdiff
path: root/sbin/ccdconfig
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1997-09-14 08:52:14 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1997-09-14 08:52:14 +0000
commitf92cfe41722b8bc85b66362d387122e7290a5545 (patch)
treeae3029815b84218d599c481c4ae24953f0c9887a /sbin/ccdconfig
parente3464869a70cf46fb7531183e88b59c4935b4dcc (diff)
Wall
Diffstat (limited to 'sbin/ccdconfig')
-rw-r--r--sbin/ccdconfig/ccdconfig.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/sbin/ccdconfig/ccdconfig.c b/sbin/ccdconfig/ccdconfig.c
index 8a02448477b..9af54b3e4d9 100644
--- a/sbin/ccdconfig/ccdconfig.c
+++ b/sbin/ccdconfig/ccdconfig.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ccdconfig.c,v 1.8 1997/05/28 21:51:47 deraadt Exp $ */
+/* $OpenBSD: ccdconfig.c,v 1.9 1997/09/14 08:52:13 deraadt Exp $ */
/* $NetBSD: ccdconfig.c,v 1.6 1996/05/16 07:11:18 thorpej Exp $ */
/*-
@@ -100,7 +100,6 @@ static int do_single __P((int, char **, int));
static int do_all __P((int));
static int dump_ccd __P((int, char **));
static int flags_to_val __P((char *));
-static int pathtodevt __P((char *, dev_t *));
static void print_ccd_info __P((struct ccd_softc *, kvm_t *));
static char *resolve_ccdname __P((char *));
static void usage __P((void));
@@ -189,6 +188,7 @@ main(argc, argv)
/* NOTREACHED */
}
/* NOTREACHED */
+ exit(0);
}
static int
@@ -199,9 +199,9 @@ do_single(argc, argv, action)
{
struct ccd_ioctl ccio;
char *ccd, *cp, *cp2, **disks;
- int noflags = 0, i, ileave, flags, j, error;
+ int noflags = 0, i, ileave, flags = 0, j;
- bzero(&ccio, sizeof(ccio));
+ memset(&ccio, 0, sizeof(ccio));
/*
* If unconfiguring, all arguments are treated as ccds.
@@ -318,7 +318,7 @@ do_all(action)
FILE *f;
char line[_POSIX2_LINE_MAX];
char *cp, **argv;
- int argc, rval;
+ int argc, rval = 0;
gid_t egid;
egid = getegid();
@@ -396,7 +396,6 @@ pathtounit(path, unitp)
int *unitp;
{
struct stat st;
- dev_t dev;
int maxpartitions;
if (stat(path, &st) != 0)
@@ -417,7 +416,7 @@ static char *
resolve_ccdname(name)
char *name;
{
- char c, *cp, *path;
+ char c, *path;
size_t len, newlen;
int rawpart;
@@ -432,7 +431,7 @@ resolve_ccdname(name)
newlen = len + 8;
if ((path = malloc(newlen)) == NULL)
return (NULL);
- bzero(path, newlen);
+ memset(path, 0, newlen);
if (isdigit(c)) {
if ((rawpart = getrawpartition()) < 0) {
@@ -498,7 +497,7 @@ dump_ccd(argc, argv)
int i, error, numccd, numconfiged = 0;
kvm_t *kd;
- bzero(errbuf, sizeof(errbuf));
+ memset(errbuf, 0, sizeof(errbuf));
if ((kd = kvm_openfiles(kernel, core, NULL, O_RDONLY,
errbuf)) == NULL) {
@@ -525,7 +524,7 @@ dump_ccd(argc, argv)
warnx("no memory for configuration data");
goto bad;
}
- bzero(cs, readsize);
+ memset(cs, 0, readsize);
/*
* Read the ccd configuration data from the kernel and dump
@@ -605,7 +604,7 @@ print_ccd_info(cs, kd)
cs->sc_unit);
return;
}
- bzero(cip, readsize);
+ memset(cip, 0, readsize);
/* Dump out softc information. */
printf("ccd%d\t\t%d\t%d\t", cs->sc_unit, cs->sc_ileave,