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:
Michael Lotz 2008-10-13 12:34:44 +00:00
parent f3142445ae
commit ecb3d008d6

View File

@ -69,9 +69,7 @@ KDiskDevice::SetTo(const char *path)
if (error != B_OK)
return error;
} else {
// no media: try to get the device geometry, but don't fail, if
// we can't get it
if (GetGeometry(&fDeviceData.geometry) != B_OK)
// no media present: reset the geometry
_ResetGeometry();
}