add error return from MountCard

This commit is contained in:
Glenn Maynard
2005-05-22 01:44:37 +00:00
parent 4c8c5bea37
commit 48f74fb55e
2 changed files with 6 additions and 4 deletions
+5 -3
View File
@@ -568,11 +568,11 @@ void MemoryCardManager::UnlockCards()
} }
/* Called just before reading or writing to the memory card. Should block. */ /* Called just before reading or writing to the memory card. Should block. */
void MemoryCardManager::MountCard( PlayerNumber pn, int iTimeout ) bool MemoryCardManager::MountCard( PlayerNumber pn, int iTimeout )
{ {
LOG->Trace( "MemoryCardManager::MountCard(%i)", pn ); LOG->Trace( "MemoryCardManager::MountCard(%i)", pn );
if( GetCardState(pn) != MEMORY_CARD_STATE_READY ) if( GetCardState(pn) != MEMORY_CARD_STATE_READY )
return; return false;
ASSERT( !m_Device[pn].IsBlank() ); ASSERT( !m_Device[pn].IsBlank() );
/* Pause the mounting thread when we mount the first drive. */ /* Pause the mounting thread when we mount the first drive. */
@@ -591,7 +591,7 @@ void MemoryCardManager::MountCard( PlayerNumber pn, int iTimeout )
if( bStartingMemoryCardAccess ) if( bStartingMemoryCardAccess )
this->UnPauseMountingThread(); this->UnPauseMountingThread();
return; return false;
} }
m_bMounted[pn] = true; m_bMounted[pn] = true;
@@ -623,6 +623,8 @@ void MemoryCardManager::MountCard( PlayerNumber pn, int iTimeout )
FILEMAN->ReleaseFileDriver( pDriver ); FILEMAN->ReleaseFileDriver( pDriver );
} }
return true;
} }
/* Called in EndGame just after writing the profile. Called by PlayersFinalized just after /* Called in EndGame just after writing the profile. Called by PlayersFinalized just after
+1 -1
View File
@@ -22,7 +22,7 @@ public:
void LockCards(); // prevent removing or changing of memory cards void LockCards(); // prevent removing or changing of memory cards
void UnlockCards(); void UnlockCards();
void MountCard( PlayerNumber pn, int iTimeout = 10 ); bool MountCard( PlayerNumber pn, int iTimeout = 10 );
void UnmountCard( PlayerNumber pn ); void UnmountCard( PlayerNumber pn );
/* When paused, no changes in memory card state will be noticed until unpaused. */ /* When paused, no changes in memory card state will be noticed until unpaused. */