Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F163359978
D15629.id43176.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D15629.id43176.diff
View Options
Index: stand/userboot/userboot/main.c
===================================================================
--- stand/userboot/userboot/main.c
+++ stand/userboot/userboot/main.c
@@ -155,20 +155,19 @@
extract_currdev(void)
{
struct disk_devdesc dev;
-
- //bzero(&dev, sizeof(dev));
-
+ struct devdesc *dd;
#if defined(USERBOOT_ZFS_SUPPORT)
+ struct zfs_devdesc zdev;
+
CTASSERT(sizeof(struct disk_devdesc) >= sizeof(struct zfs_devdesc));
if (userboot_zfs_found) {
- struct zfs_devdesc zdev;
/* Leave the pool/root guid's unassigned */
bzero(&zdev, sizeof(zdev));
zdev.dd.d_dev = &zfs_dev;
- dev = *(struct disk_devdesc *)&zdev;
- init_zfs_bootenv(zfs_fmtdev(&dev));
+ init_zfs_bootenv(zfs_fmtdev(&zdev));
+ dd = &zdev.dd;
} else
#endif
@@ -185,14 +184,16 @@
dev.d_slice = -1;
dev.d_partition = -1;
}
+ dd = &dev.dd;
} else {
dev.dd.d_dev = &host_dev;
dev.dd.d_unit = 0;
+ dd = &dev.dd;
}
- env_setenv("currdev", EV_VOLATILE, userboot_fmtdev(&dev),
+ env_setenv("currdev", EV_VOLATILE, userboot_fmtdev(dd),
userboot_setcurrdev, env_nounset);
- env_setenv("loaddev", EV_VOLATILE, userboot_fmtdev(&dev),
+ env_setenv("loaddev", EV_VOLATILE, userboot_fmtdev(dd),
env_noset, env_nounset);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jul 23, 12:12 PM (7 h, 50 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35401526
Default Alt Text
D15629.id43176.diff (1 KB)
Attached To
Mode
D15629: Pass a struct devdesc to the format commands. Use proper type rather than doing weird type-punning that happened to work because the size was right :(
Attached
Detach File
Event Timeline
Log In to Comment