summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgrog <grog@FreeBSD.org>2000-03-02 07:46:10 +0000
committergrog <grog@FreeBSD.org>2000-03-02 07:46:10 +0000
commitcca4cf9728ba697feaf13531ccd8ad2667e56233 (patch)
tree8aa986057faf6bd8d13d21fc65ab7f04ece8c4d8
parentb3d817cd5704469b459b8ac9642433c79251ccd6 (diff)
downloadFreeBSD-src-cca4cf9728ba697feaf13531ccd8ad2667e56233.zip
FreeBSD-src-cca4cf9728ba697feaf13531ccd8ad2667e56233.tar.gz
Fix a problem with device number parsing, which caused da10 to map to
da1, and da11 to da2. Reported by: Dan Nelson <dnelson@emsphone.com> Implicitly-approved-by: jkh
-rw-r--r--sys/dev/vinum/vinumio.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/dev/vinum/vinumio.c b/sys/dev/vinum/vinumio.c
index 50203e3..17fc5fe 100644
--- a/sys/dev/vinum/vinumio.c
+++ b/sys/dev/vinum/vinumio.c
@@ -90,9 +90,9 @@ open_drive(struct drive *drive, struct proc *p, int verbose)
* Create a minor number for each of them.
*/
unit = 0;
- while ((dname[0] >= '0') /* invalid unit */
- &&(dname[0] <= '9')) {
- unit += dname[0] - '0';
+ while ((*dname >= '0') /* unit number */
+ &&(*dname <= '9')) {
+ unit = unit * 10 + *dname - '0';
dname++;
}
@@ -104,9 +104,9 @@ open_drive(struct drive *drive, struct proc *p, int verbose)
+(dname[2] - 'a') /* partition */
+((dname[1] - '0' + 1) << 16); /* slice */
} else { /* compatibility partition */
- if ((dname[0] < 'a') || (dname[0] > 'h')) /* or invalid partition */
+ if ((*dname < 'a') || (*dname > 'h')) /* or invalid partition */
return ENODEV;
- devminor = (dname[0] - 'a') /* partition */
+ devminor = (*dname - 'a') /* partition */
+(unit << 3); /* unit */
}
OpenPOWER on IntegriCloud