Correctly skip the '/dev/' part when creating new drives and prefix
a drive's provider with '/dev/' when printing the config. Reported by: will@
This commit is contained in:
parent
79e295e875
commit
d9d3a74c87
@ -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 = token[j];
|
||||
if (*ptr == '/') {
|
||||
ptr++;
|
||||
while (*ptr != '/')
|
||||
ptr++;
|
||||
ptr++;
|
||||
}
|
||||
strncpy(d->device, ptr, GV_MAXDRIVENAME);
|
||||
} else {
|
||||
/* We assume this is the drive name. */
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user