unmount fix

This commit is contained in:
Glenn Maynard
2004-03-15 03:51:39 +00:00
parent ed17ae0d3e
commit 725cdd7e5b
2 changed files with 17 additions and 0 deletions
@@ -53,6 +53,11 @@ bool MemoryCardDriver_Linux::StorageDevicesChanged()
void MemoryCardDriver_Linux::GetStorageDevices( vector<UsbStorageDevice>& vDevicesOut )
{
UsbStorageDevice usbd;
usbd.sOsMountDir = "/mnt";
vDevicesOut.push_back( usbd );
return;
usleep(1000);
/* If we couldn't open it before, we probably can't open it now; don't
@@ -260,7 +265,13 @@ bool MemoryCardDriver_Linux::MountAndTestWrite( UsbStorageDevice* pDevice, CStri
vector<RageFileManager::DriverLocation> Mounts;
FILEMAN->GetLoadedDrivers( Mounts );
for( unsigned i = 0; i < Mounts.size(); ++i )
{
if( Mounts[i].Type.CompareNoCase( "dir" ) )
continue; // wrong type
if( Mounts[i].Root.CompareNoCase( pDevice->sOsMountDir ) )
continue; // wrong root
FILEMAN->Unmount( Mounts[i].Type, Mounts[i].Root, Mounts[i].MountPoint );
}
FILEMAN->Mount( "dir", pDevice->sOsMountDir, sMountPoint.c_str() );
LOG->Trace( "FILEMAN->Mount %s %s", pDevice->sOsMountDir.c_str(), sMountPoint.c_str() );
@@ -87,7 +87,13 @@ bool MemoryCardDriver_Windows::MountAndTestWrite( UsbStorageDevice* pDevice, CSt
vector<RageFileManager::DriverLocation> Mounts;
FILEMAN->GetLoadedDrivers( Mounts );
for( unsigned i = 0; i < Mounts.size(); ++i )
{
if( Mounts[i].Type.CompareNoCase( "dir" ) )
continue; // wrong type
if( Mounts[i].Root.CompareNoCase( pDevice->sOsMountDir ) )
continue; // wrong root
FILEMAN->Unmount( Mounts[i].Type, Mounts[i].Root, Mounts[i].MountPoint );
}
FILEMAN->Mount( "dir", pDevice->sOsMountDir, sMountPoint.c_str() );
LOG->Trace( "FILEMAN->Mount %s %s", pDevice->sOsMountDir.c_str(), sMountPoint.c_str() );