summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/dtable.cc
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2016-06-23 16:56:41 +0200
committerCorinna Vinschen <corinna@vinschen.de>2016-06-23 16:56:41 +0200
commitb2867a68b9f94402e2afba49de978d9e8f9abaeb (patch)
tree484960735e607552fbb5704f9e8f83eedab77f4a /winsup/cygwin/dtable.cc
parentbceb8ebebb78612cd1da16790ce30d37eddbe244 (diff)
downloadcygnal-b2867a68b9f94402e2afba49de978d9e8f9abaeb.tar.gz
cygnal-b2867a68b9f94402e2afba49de978d9e8f9abaeb.tar.bz2
cygnal-b2867a68b9f94402e2afba49de978d9e8f9abaeb.zip
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>
Diffstat (limited to 'winsup/cygwin/dtable.cc')
-rw-r--r--winsup/cygwin/dtable.cc17
1 files changed, 6 insertions, 11 deletions
diff --git a/winsup/cygwin/dtable.cc b/winsup/cygwin/dtable.cc
index 0f995e4290..14245e6aa 100644
--- a/winsup/cygwin/dtable.cc
+++ b/winsup/cygwin/dtable.cc
@@ -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;