mirror of
https://github.com/LIV2/lide.device.git
synced 2025-12-06 00:32:45 +00:00
open(): Need to mark the ioreq as complete to prevent hanging.
If the IORequest is not marked as complete at open() then CheckIO will consider it as "in-use" and WaitIO will hang. This closes #11
This commit is contained in:
parent
d1fe9e98b1
commit
fba82e5f75
11
driver.c
11
driver.c
@ -550,8 +550,15 @@ static void __attribute__((used, saveds)) open(struct DeviceBase *dev asm("a6"),
|
||||
|
||||
ioreq->io_Unit = (struct Unit *)unit;
|
||||
|
||||
// Set io_Message type to NT_MESSAGE to make sure CheckIO() functions correctly
|
||||
ioreq->io_Message.mn_Node.ln_Type = NT_MESSAGE;
|
||||
/* IMPORTANT: Mark IORequest as "complete" or otherwise CheckIO() may
|
||||
* consider it as "in use" in spite of never having been
|
||||
* used at all. This also avoids that WaitIO() will hang
|
||||
* on an IORequest which has never been used.
|
||||
*
|
||||
* Source: Olaf Barthel's Trackfile.device
|
||||
* https://github.com/obarthel/trackfile-device
|
||||
*/
|
||||
ioreq->io_Message.mn_Node.ln_Type = NT_REPLYMSG;
|
||||
|
||||
// Send a TD_CHANGESTATE ioreq for the unit if it is ATAPI and not already open
|
||||
// This will update the media presence & geometry
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user