diff options
author | le <le@FreeBSD.org> | 2004-10-02 20:12:20 +0000 |
---|---|---|
committer | le <le@FreeBSD.org> | 2004-10-02 20:12:20 +0000 |
commit | 8ff45b174246a9f11538243c680820789ed17e3a (patch) | |
tree | eef29a33cf3296c34e234908b882f285b5d380dd /sys/geom/vinum | |
parent | f697f4f13edf786a14bda731cb55d404c64e89bf (diff) | |
download | FreeBSD-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.c | 11 | ||||
-rw-r--r-- | sys/geom/vinum/geom_vinum_subr.c | 2 |
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); } } |