aboutsummaryrefslogtreecommitdiff
path: root/winsup/cygwin/fhandler_floppy.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/fhandler_floppy.cc
parentbceb8ebebb78612cd1da16790ce30d37eddbe244 (diff)
downloadnewlib-b2867a68b9f94402e2afba49de978d9e8f9abaeb.zip
newlib-b2867a68b9f94402e2afba49de978d9e8f9abaeb.tar.gz
newlib-b2867a68b9f94402e2afba49de978d9e8f9abaeb.tar.bz2
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/fhandler_floppy.cc')
-rw-r--r--winsup/cygwin/fhandler_floppy.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/winsup/cygwin/fhandler_floppy.cc b/winsup/cygwin/fhandler_floppy.cc
index 15b727b..8c9ef9d 100644
--- a/winsup/cygwin/fhandler_floppy.cc
+++ b/winsup/cygwin/fhandler_floppy.cc
@@ -159,8 +159,9 @@ fhandler_dev_floppy::lock_partition (DWORD to_write)
/* The simple case. We have only a single partition open anyway.
Try to lock the partition so that a subsequent write succeeds.
If there's some file handle open on one of the affected partitions,
- this fails, but that's how it works on Vista and later... */
- if (get_minor () % 16 != 0)
+ this fails, but that's how it works on Vista and later...
+ Only DEV_SD7_MAJOR and less can point to partition 0. */
+ if (get_major () <= DEV_SD7_MAJOR && get_minor () % 16 != 0)
{
if (!DeviceIoControl (get_handle (), FSCTL_LOCK_VOLUME,
NULL, 0, NULL, 0, &bytes_read, NULL))