summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authordd <dd@FreeBSD.org>2001-06-21 02:10:26 +0000
committerdd <dd@FreeBSD.org>2001-06-21 02:10:26 +0000
commit869b11442ded05e5e48acc47ea0896d83d8ea198 (patch)
tree8d1ef80a8f6a0b3e2e2387bd0ba23dbfbaecd51f /sbin
parentea812de5fbc6857b0657cc67544c3a73895ef4fa (diff)
downloadFreeBSD-src-869b11442ded05e5e48acc47ea0896d83d8ea198.zip
FreeBSD-src-869b11442ded05e5e48acc47ea0896d83d8ea198.tar.gz
Constify mdmaybeload(), add a prototype for usage(), and get rid of a
sizeof(int) == sizeof(long) assumption; clamp down with WARNS=2.
Diffstat (limited to 'sbin')
-rw-r--r--sbin/mdconfig/Makefile1
-rw-r--r--sbin/mdconfig/mdconfig.c8
2 files changed, 6 insertions, 3 deletions
diff --git a/sbin/mdconfig/Makefile b/sbin/mdconfig/Makefile
index 3abf56b..e6f2db4 100644
--- a/sbin/mdconfig/Makefile
+++ b/sbin/mdconfig/Makefile
@@ -1,6 +1,7 @@
# $FreeBSD$
PROG= mdconfig
+WARNS?= 2
MAN= mdconfig.8
MLINKS= mdconfig.8 vnconfig.8
diff --git a/sbin/mdconfig/mdconfig.c b/sbin/mdconfig/mdconfig.c
index 15cbbef..f95223d 100644
--- a/sbin/mdconfig/mdconfig.c
+++ b/sbin/mdconfig/mdconfig.c
@@ -32,6 +32,7 @@ struct md_ioctl mdio;
enum {UNSET, ATTACH, DETACH, LIST} action = UNSET;
void mdmaybeload(void);
+void usage(void);
void
usage()
@@ -200,10 +201,11 @@ int
list(const int fd)
{
char *disklist, *p, *p2, *p3;
- int unit, dll;
+ int unit;
+ size_t dll;
struct dl *dp, *di, *dn;
- if (sysctlbyname("kern.disks", NULL, &dll, NULL, NULL) == -1)
+ if (sysctlbyname("kern.disks", NULL, &dll, NULL, 0) == -1)
err(1, "sysctlbyname: kern.disks");
if ( (disklist = malloc(dll)) == NULL)
err(1, "malloc");
@@ -280,7 +282,7 @@ mdmaybeload(void)
{
struct module_stat mstat;
int fileid, modid;
- char *name = "md";
+ const char *name = "md";
char *cp;
/* scan files in kernel */
OpenPOWER on IntegriCloud