- if ((biw = lookup_bootinfo(BTINFO_BOOTWEDGE)) != NULL) {
+ bid = lookup_bootinfo(BTINFO_BOOTDISK);
+ biw = lookup_bootinfo(BTINFO_BOOTWEDGE);
+
+ if (biw != NULL) {
/*
* Scan all disk devices for ones that match the passed data.
* Don't break if one is found, to get possible multiple
@@ -382,7 +385,7 @@
continue;
}
booted_device = dv;
- booted_partition = 0;
+ booted_partition = bid != NULL ? bid->partition : 0;
booted_nblks = biw->nblks;
booted_startblk = biw->startblk;
}
@@ -392,7 +395,7 @@
return;
}
- if ((bid = lookup_bootinfo(BTINFO_BOOTDISK)) != NULL) {
+ if (bid != NULL) {
/*
* Scan all disk devices for ones that match the passed data.
* Don't break if one is found, to get possible multiple