From ecb3d008d625d9657d492978d1053ad6e31a01ee Mon Sep 17 00:00:00 2001 From: Michael Lotz Date: Mon, 13 Oct 2008 12:34:44 +0000 Subject: [PATCH] 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 --- src/system/kernel/disk_device_manager/KDiskDevice.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/system/kernel/disk_device_manager/KDiskDevice.cpp b/src/system/kernel/disk_device_manager/KDiskDevice.cpp index bd084f50f3..567feba020 100644 --- a/src/system/kernel/disk_device_manager/KDiskDevice.cpp +++ b/src/system/kernel/disk_device_manager/KDiskDevice.cpp @@ -69,10 +69,8 @@ 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) - _ResetGeometry(); + // no media present: reset the geometry + _ResetGeometry(); } // set device flags