The last of the changes, I hope.

This commit is contained in:
Steve Checkoway
2006-05-14 07:04:28 +00:00
parent ea19495a50
commit f39e79efed
5 changed files with 292 additions and 3 deletions
@@ -169,11 +169,20 @@ void MemoryCardDriverThreaded_OSX::GetUSBStorageDevices( vector<UsbStorageDevice
RString::size_type pos = sRegistryPath.rfind( "/IOUSBMassStorageClass" );
if( pos == RString::npos )
continue; // Probably not a USB device.
{
// Probably not a USB device.
LOG->Trace( "Device \"%s\" (%s) has IOServicePlane path: %s.",
fs[i].f_mntfromname, fs[i].f_mntonname, path );
continue;
}
// The path does not start with / so pos - 1 >= 0.
pos = sRegistryPath.rfind( '/', pos - 1 );
if( pos == RString::npos )
continue; // Something is horribly wrong at this point.
{
// Something is horribly wrong at this point.
LOG->Trace( "Device has unusual IOServicePlane path: %s", path );
continue;
}
path[pos] = '\0';
io_registry_entry_t device = IORegistryEntryFromPath( kIOMasterPortDefault, path );