Handle up to 63 partitions per drive
Revamp device parsing code. Introducing support for more partitions into the shilka-generated parser has the unfortunate side-effect of raising the size of the DLL by almost 2 Megs. Therefore we split out the handling for /dev/sdXY devices into a tiny bit of hand-written code. While at it, remove some unused cruft from devices.* and generally clean up the device class to provide access methods instead of direct access to members. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
@ -282,7 +282,7 @@ dtable::init_std_file_from_handle (int fd, HANDLE handle)
|
||||
CONSOLE_SCREEN_BUFFER_INFO buf;
|
||||
DCB dcb;
|
||||
unsigned bin = O_BINARY;
|
||||
device dev = {};
|
||||
device dev;
|
||||
|
||||
first_fd_for_open = 0;
|
||||
|
||||
@ -451,7 +451,7 @@ build_fh_dev (const device& dev, const char *unix_name)
|
||||
if (unix_name)
|
||||
pc.set_posix (unix_name);
|
||||
else
|
||||
pc.set_posix (dev.name);
|
||||
pc.set_posix (dev.name ());
|
||||
return build_fh_pc (pc);
|
||||
}
|
||||
|
||||
@ -476,13 +476,8 @@ fh_alloc (path_conv& pc)
|
||||
case DEV_FLOPPY_MAJOR:
|
||||
case DEV_CDROM_MAJOR:
|
||||
case DEV_SD_MAJOR:
|
||||
case DEV_SD1_MAJOR:
|
||||
case DEV_SD2_MAJOR:
|
||||
case DEV_SD3_MAJOR:
|
||||
case DEV_SD4_MAJOR:
|
||||
case DEV_SD5_MAJOR:
|
||||
case DEV_SD6_MAJOR:
|
||||
case DEV_SD7_MAJOR:
|
||||
case DEV_SD1_MAJOR ... DEV_SD7_MAJOR:
|
||||
case DEV_SD_HIGHPART_START ... DEV_SD_HIGHPART_END:
|
||||
fh = cnew (fhandler_dev_floppy);
|
||||
break;
|
||||
case DEV_TAPE_MAJOR:
|
||||
@ -646,14 +641,14 @@ build_fh_pc (path_conv& pc)
|
||||
debug_printf ("found an archetype for %s(%d/%d) io_handle %p", fh->get_name (), fh->dev ().get_major (), fh->dev ().get_minor (),
|
||||
fh->archetype->get_io_handle ());
|
||||
if (!fh->get_name ())
|
||||
fh->set_name (fh->archetype->dev ().name);
|
||||
fh->set_name (fh->archetype->dev ().name ());
|
||||
}
|
||||
else if (cygwin_finished_initializing && !pc.isopen ())
|
||||
fh->set_name (pc);
|
||||
else
|
||||
{
|
||||
if (!fh->get_name ())
|
||||
fh->set_name (fh->dev ().native);
|
||||
fh->set_name (fh->dev ().native ());
|
||||
fh->archetype = fh->clone ();
|
||||
debug_printf ("created an archetype (%p) for %s(%d/%d)", fh->archetype, fh->get_name (), fh->dev ().get_major (), fh->dev ().get_minor ());
|
||||
fh->archetype->archetype = NULL;
|
||||
|
Reference in New Issue
Block a user