summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authormsmith <msmith@FreeBSD.org>1998-10-27 21:14:03 +0000
committermsmith <msmith@FreeBSD.org>1998-10-27 21:14:03 +0000
commit877e8e9a788ac5cc6ce22e15bc66e92f75a0c4a7 (patch)
tree5da6d0b489171501852b959c3b3533cbf03316d3 /lib
parent25598ad6e0d817e2c59245243b16516d1369b924 (diff)
downloadFreeBSD-src-877e8e9a788ac5cc6ce22e15bc66e92f75a0c4a7.zip
FreeBSD-src-877e8e9a788ac5cc6ce22e15bc66e92f75a0c4a7.tar.gz
Fixes for handling 'wfd' (and any other disk with a non-2-character name)
Submitted by: Some from Satoh Junichi (junichi@astec.co.jp)
Diffstat (limited to 'lib')
-rw-r--r--lib/libdisk/create_chunk.c11
-rw-r--r--lib/libdisk/write_disk.c7
2 files changed, 9 insertions, 9 deletions
diff --git a/lib/libdisk/create_chunk.c b/lib/libdisk/create_chunk.c
index 86e18f8..d5c89c6 100644
--- a/lib/libdisk/create_chunk.c
+++ b/lib/libdisk/create_chunk.c
@@ -6,7 +6,7 @@
* this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
* ----------------------------------------------------------------------------
*
- * $Id: create_chunk.c,v 1.30 1998/03/20 23:43:03 jkh Exp $
+ * $Id: create_chunk.c,v 1.31 1998/09/15 10:23:17 gibbs Exp $
*
*/
@@ -254,18 +254,17 @@ MakeDev(struct chunk *c1, const char *path)
return 0;
if (!strncmp(p, "wd", 2))
- bmaj = 0, cmaj = 3;
+ bmaj = 0, cmaj = 3, p += 2;
else if (!strncmp(p, "sd", 2))
- bmaj = 4, cmaj = 13;
+ bmaj = 4, cmaj = 13, p += 2;
else if (!strncmp(p, "wfd", 3))
- bmaj = 1, cmaj = 87;
+ bmaj = 1, cmaj = 87, p += 3;
else if (!strncmp(p, "da", 2)) /* CAM support */
- bmaj = 4, cmaj = 13;
+ bmaj = 4, cmaj = 13, p += 2;
else {
msgDebug("MakeDev: Unknown major/minor for devtype %s\n", p);
return 0;
}
- p += 2;
if (!isdigit(*p)) {
msgDebug("MakeDev: Invalid disk unit passed: %s\n", p);
return 0;
diff --git a/lib/libdisk/write_disk.c b/lib/libdisk/write_disk.c
index 6d3b2a7..799e5a1 100644
--- a/lib/libdisk/write_disk.c
+++ b/lib/libdisk/write_disk.c
@@ -6,7 +6,7 @@
* this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
* ----------------------------------------------------------------------------
*
- * $Id: write_disk.c,v 1.22 1998/09/30 21:40:51 jkh Exp $
+ * $Id: write_disk.c,v 1.23 1998/10/06 11:57:08 dfr Exp $
*
*/
@@ -64,10 +64,10 @@ Write_FreeBSD(int fd, struct disk *new, struct disk *old, struct chunk *c1)
for(c2=c1->part;c2;c2=c2->next) {
if (c2->type == unused) continue;
if (!strcmp(c2->name,"X")) continue;
- j = c2->name[5] - 'a';
+ j = c2->name[strlen(new->name) + 2] - 'a';
if (j < 0 || j >= MAXPARTITIONS || j == RAW_PART) {
#ifdef DEBUG
- warn("Weird parititon letter %c",c2->name[5]);
+ warn("Weird parititon letter %c",c2->name[strlen(new->name) + 2]);
#endif
continue;
}
@@ -173,6 +173,7 @@ Write_Disk(struct disk *d1)
if (c1->type == unused) continue;
if (!strcmp(c1->name,"X")) continue;
j = c1->name[4] - '1';
+ j = c1->name[strlen(d1->name) + 1] - '1';
if (j < 0 || j > 3)
continue;
s[j]++;
OpenPOWER on IntegriCloud