If a device reports no media is present, don't try to get the geometry anyway.
This confused some USB card readers, that would stop working if you still requested the geometry when they reported no media. Note the case that the B_GET_MEDIA_STATUS fails (because it's not implemented or an error occured) is still handeld in _GetMediaStatus() and then we still try to get the geometry to check for media presence. This should fix that some USB card readers wouldn't work and should also remove the wrongly reported size in DriveSetup for CD drives that don't actually contain a media. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28029 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -69,10 +69,8 @@ KDiskDevice::SetTo(const char *path)
|
|||||||
if (error != B_OK)
|
if (error != B_OK)
|
||||||
return error;
|
return error;
|
||||||
} else {
|
} else {
|
||||||
// no media: try to get the device geometry, but don't fail, if
|
// no media present: reset the geometry
|
||||||
// we can't get it
|
_ResetGeometry();
|
||||||
if (GetGeometry(&fDeviceData.geometry) != B_OK)
|
|
||||||
_ResetGeometry();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// set device flags
|
// set device flags
|
||||||
|
|||||||
Reference in New Issue
Block a user