mirror of
https://github.com/akuker/RASCSI.git
synced 2024-11-26 13:49:21 +00:00
Flush the cache on STOP UNIT (#644)
This commit is contained in:
parent
36cadd78fc
commit
9d0d78a643
@ -1293,16 +1293,21 @@ bool Disk::StartStop(const DWORD *cdb)
|
|||||||
SetStopped(!start);
|
SetStopped(!start);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Look at the eject bit and eject if necessary
|
if (!start) {
|
||||||
if (load && !start) {
|
// Flush the cache when stopping
|
||||||
if (IsLocked()) {
|
disk.dcache->Save();
|
||||||
// Cannot be ejected because it is locked
|
|
||||||
SetStatusCode(STATUS_PREVENT);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Eject
|
// Look at the eject bit and eject if necessary
|
||||||
return Eject(false);
|
if (load) {
|
||||||
|
if (IsLocked()) {
|
||||||
|
// Cannot be ejected because it is locked
|
||||||
|
SetStatusCode(STATUS_PREVENT);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Eject
|
||||||
|
return Eject(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user