summaryrefslogtreecommitdiff
path: root/usr.bin/vmstat/dkstats.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/vmstat/dkstats.c')
-rw-r--r--usr.bin/vmstat/dkstats.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/usr.bin/vmstat/dkstats.c b/usr.bin/vmstat/dkstats.c
index f7877d52c4b..fbc0ddce74f 100644
--- a/usr.bin/vmstat/dkstats.c
+++ b/usr.bin/vmstat/dkstats.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dkstats.c,v 1.34 2010/07/20 19:43:19 lum Exp $ */
+/* $OpenBSD: dkstats.c,v 1.35 2010/09/24 00:11:15 deraadt Exp $ */
/* $NetBSD: dkstats.c,v 1.1 1996/05/10 23:19:27 thorpej Exp $ */
/*
@@ -198,8 +198,14 @@ dkreadstats(void)
if (sysctl(mib, 2, disknames, &size, NULL, 0) < 0)
err(1, "can't get hw.disknames");
bufpp = disknames;
- for (i = 0; i < dk_ndrive && (name = strsep(&bufpp, ",")) != NULL; i++)
+ for (i = 0; i < dk_ndrive &&
+ (name = strsep(&bufpp, ",")) != NULL; i++)
dk_name[i] = name;
+ for (i = 0; i < dk_ndrive; i++) {
+ char *p = strchr(dk_name[i], ':');
+ if (p)
+ *p = '\0';
+ }
disknames = cur.dk_name[0]; /* To free old names. */
if (dk_ndrive < cur.dk_ndrive) {
@@ -528,6 +534,11 @@ dkinit(int sel)
cur.dk_name[i] = name;
cur.dk_select[i] = sel;
}
+ for (i = 0; i < dk_ndrive; i++) {
+ char *p = strchr(cur.dk_name[i], ':');
+ if (p)
+ *p = '\0';
+ }
} else {
#if !defined(NOKVM)
p = dk_drivehead;