From 8ff45b174246a9f11538243c680820789ed17e3a Mon Sep 17 00:00:00 2001 From: le Date: Sat, 2 Oct 2004 20:12:20 +0000 Subject: Correctly skip the '/dev/' part when creating new drives and prefix a drive's provider with '/dev/' when printing the config. Reported by: will@ --- sys/geom/vinum/geom_vinum_share.c | 11 +++++++---- sys/geom/vinum/geom_vinum_subr.c | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) (limited to 'sys/geom/vinum') 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); } } -- cgit v1.1