Use getmaxpartitions() and getrawpartition() from libutil, not homegrown
versions.
This commit is contained in:
parent
0cb9c8e106
commit
8a5bb3e806
|
@ -1,4 +1,4 @@
|
||||||
# $NetBSD: Makefile,v 1.1 1995/08/17 16:37:17 thorpej Exp $
|
# $NetBSD: Makefile,v 1.2 1996/05/16 07:11:17 thorpej Exp $
|
||||||
|
|
||||||
PROG= ccdconfig
|
PROG= ccdconfig
|
||||||
MAN= ccdconfig.8
|
MAN= ccdconfig.8
|
||||||
|
@ -6,7 +6,7 @@ MAN= ccdconfig.8
|
||||||
BINGRP= kmem
|
BINGRP= kmem
|
||||||
BINMODE=2555
|
BINMODE=2555
|
||||||
|
|
||||||
DPADD= ${LIBKVM}
|
DPADD= ${LIBKVM} ${LIBUTIL}
|
||||||
LDADD= -lkvm
|
LDADD= -lkvm -lutil
|
||||||
|
|
||||||
.include <bsd.prog.mk>
|
.include <bsd.prog.mk>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: ccdconfig.c,v 1.5 1996/02/28 01:01:18 thorpej Exp $ */
|
/* $NetBSD: ccdconfig.c,v 1.6 1996/05/16 07:11:18 thorpej Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1996 The NetBSD Foundation, Inc.
|
* Copyright (c) 1996 The NetBSD Foundation, Inc.
|
||||||
|
@ -54,6 +54,7 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <util.h>
|
||||||
|
|
||||||
#include <dev/ccdvar.h>
|
#include <dev/ccdvar.h>
|
||||||
|
|
||||||
|
@ -97,8 +98,6 @@ static int do_io __P((char *, u_long, struct ccd_ioctl *));
|
||||||
static int do_single __P((int, char **, int));
|
static int do_single __P((int, char **, int));
|
||||||
static int do_all __P((int));
|
static int do_all __P((int));
|
||||||
static int dump_ccd __P((int, char **));
|
static int dump_ccd __P((int, char **));
|
||||||
static int getmaxpartitions __P((void));
|
|
||||||
static int getrawpartition __P((void));
|
|
||||||
static int flags_to_val __P((char *));
|
static int flags_to_val __P((char *));
|
||||||
static int pathtodevt __P((char *, dev_t *));
|
static int pathtodevt __P((char *, dev_t *));
|
||||||
static void print_ccd_info __P((struct ccd_softc *, kvm_t *));
|
static void print_ccd_info __P((struct ccd_softc *, kvm_t *));
|
||||||
|
@ -624,36 +623,6 @@ print_ccd_info(cs, kd)
|
||||||
free(cip);
|
free(cip);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
|
||||||
getmaxpartitions()
|
|
||||||
{
|
|
||||||
int maxpart, mib[2];
|
|
||||||
size_t varlen;
|
|
||||||
|
|
||||||
mib[0] = CTL_KERN;
|
|
||||||
mib[1] = KERN_MAXPARTITIONS;
|
|
||||||
varlen = sizeof(maxpart);
|
|
||||||
if (sysctl(mib, 2, &maxpart, &varlen, NULL, 0) < 0)
|
|
||||||
return (-1);
|
|
||||||
|
|
||||||
return (maxpart);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
|
||||||
getrawpartition()
|
|
||||||
{
|
|
||||||
int rawpart, mib[2];
|
|
||||||
size_t varlen;
|
|
||||||
|
|
||||||
mib[0] = CTL_KERN;
|
|
||||||
mib[1] = KERN_RAWPARTITION;
|
|
||||||
varlen = sizeof(rawpart);
|
|
||||||
if (sysctl(mib, 2, &rawpart, &varlen, NULL, 0) < 0)
|
|
||||||
return (-1);
|
|
||||||
|
|
||||||
return (rawpart);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
flags_to_val(flags)
|
flags_to_val(flags)
|
||||||
char *flags;
|
char *flags;
|
||||||
|
|
Loading…
Reference in New Issue