Disable SCSIRead() if no buffer provided. Some commands, like TEST_UNIT, don't read data from device

This commit is contained in:
Laurent Vivier 2006-11-01 17:43:48 +00:00
parent 1153cd593a
commit 5feb420909

View File

@ -71,12 +71,15 @@ int scsi_command(int target, char* cdb, int count, TIB_t* tib)
goto complete;
}
if (tib != NULL)
{
err = SCSIRead(tib);
if ((err != scPhaseErr) && (err != noErr))
{
printf("Cannot read data (%d)\n", err);
goto complete;
}
}
complete:
err = SCSIComplete(&stat, &message, COMPLETION_TIMEOUT);