Browse Source

Correctly report read-only images as write protected to host.

Previously MODE SENSE didn't report the write protected bit even
if the image file was set to read-only. Any write requests would
then fail with error.

After this commit the drive will appear write protected to the host.
Petteri Aimonen 8 tháng trước cách đây
mục cha
commit
ce8986b6b2
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      src/ZuluSCSI_disk.cpp

+ 1 - 1
src/ZuluSCSI_disk.cpp

@@ -2355,7 +2355,7 @@ int scsiDiskCommand()
 
 
         scsiDev.phase = DATA_IN;
         scsiDev.phase = DATA_IN;
     }
     }
-    else if (img.file.isRom())
+    else if (!img.file.isWritable())
     {
     {
         // Special handling for ROM drive to make SCSI2SD code report it as read-only
         // Special handling for ROM drive to make SCSI2SD code report it as read-only
         blockDev.state |= DISK_WP;
         blockDev.state |= DISK_WP;