summaryrefslogtreecommitdiffstats
path: root/sys/geom/vinum
diff options
context:
space:
mode:
authorle <le@FreeBSD.org>2004-10-02 20:12:20 +0000
committerle <le@FreeBSD.org>2004-10-02 20:12:20 +0000
commit8ff45b174246a9f11538243c680820789ed17e3a (patch)
treeeef29a33cf3296c34e234908b882f285b5d380dd /sys/geom/vinum
parentf697f4f13edf786a14bda731cb55d404c64e89bf (diff)
downloadFreeBSD-src-8ff45b174246a9f11538243c680820789ed17e3a.zip
FreeBSD-src-8ff45b174246a9f11538243c680820789ed17e3a.tar.gz
Correctly skip the '/dev/' part when creating new drives and prefix
a drive's provider with '/dev/' when printing the config. Reported by: will@
Diffstat (limited to 'sys/geom/vinum')
-rw-r--r--sys/geom/vinum/geom_vinum_share.c11
-rw-r--r--sys/geom/vinum/geom_vinum_subr.c2
2 files changed, 8 insertions, 5 deletions
diff --git a/sys/geom/vinum/geom_vinum_share.c b/sys/geom/vinum/geom_vinum_share.c
index 5cb4dab..2b572c3 100644
--- a/sys/geom/vinum/geom_vinum_share.c
+++ b/sys/geom/vinum/geom_vinum_share.c
@@ -402,10 +402,13 @@ gv_new_drive(int max, char *token[])
errors++;
break;
}
- ptr = token[j] + strlen(token[j]);
- while (ptr != token[j] && *ptr != '/')
- ptr--;
- ptr++;
+ ptr = token[j];
+ if (*ptr == '/') {
+ ptr++;
+ while (*ptr != '/')
+ ptr++;
+ ptr++;
+ }
strncpy(d->device, ptr, GV_MAXDRIVENAME);
} else {
/* We assume this is the drive name. */
diff --git a/sys/geom/vinum/geom_vinum_subr.c b/sys/geom/vinum/geom_vinum_subr.c
index 8ebe135..1821cfd 100644
--- a/sys/geom/vinum/geom_vinum_subr.c
+++ b/sys/geom/vinum/geom_vinum_subr.c
@@ -189,7 +189,7 @@ gv_format_config(struct gv_softc *sc, struct sbuf *sb, int ondisk, char *prefix)
*/
if (!ondisk) {
LIST_FOREACH(d, &sc->drives, drive) {
- sbuf_printf(sb, "%sdrive %s device %s\n", prefix,
+ sbuf_printf(sb, "%sdrive %s device /dev/%s\n", prefix,
d->name, d->device);
}
}
OpenPOWER on IntegriCloud