summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/fhandler_floppy.cc
diff options
context:
space:
mode:
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 15b727bef..8c9ef9d02 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))