mirror of
https://github.com/akuker/RASCSI.git
synced 2025-01-02 09:35:58 +00:00
Fixed detach, which did not remove the filename from the filenames set
This commit is contained in:
parent
4084ef07a1
commit
7b84972b4d
@ -33,7 +33,7 @@
|
||||
#include "interfaces/scsi_block_commands.h"
|
||||
#include "interfaces/scsi_primary_commands.h"
|
||||
|
||||
class Disk : public Device, public ScsiPrimaryCommands, public ScsiBlockCommands
|
||||
class Disk : public Device, ScsiPrimaryCommands, ScsiBlockCommands
|
||||
{
|
||||
private:
|
||||
enum access_mode { RW6, RW10, RW16 };
|
||||
|
@ -862,12 +862,13 @@ bool ProcessCmd(int fd, const PbDeviceDefinition& pb_device, const PbOperation o
|
||||
}
|
||||
}
|
||||
|
||||
FileSupport *fileSupport = dynamic_cast<FileSupport *>(device);
|
||||
|
||||
if (operation == DETACH) {
|
||||
if (!dryRun) {
|
||||
device = map[id * UnitNum + unit];
|
||||
|
||||
map[id * UnitNum + unit] = NULL;
|
||||
|
||||
FileSupport *fileSupport = dynamic_cast<FileSupport *>(device);
|
||||
if (fileSupport) {
|
||||
Filepath filepath;
|
||||
fileSupport->GetPath(filepath);
|
||||
@ -886,6 +887,8 @@ bool ProcessCmd(int fd, const PbDeviceDefinition& pb_device, const PbOperation o
|
||||
}
|
||||
}
|
||||
|
||||
FileSupport *fileSupport = dynamic_cast<FileSupport *>(device);
|
||||
|
||||
if ((operation == INSERT || operation == EJECT) && !device->IsRemovable()) {
|
||||
return ReturnStatus(fd, false, PbOperation_Name(operation) + " operation denied (" + device->GetType() + " isn't removable)");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user