add error return from MountCard
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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. */
|
||||||
|
|||||||
Reference in New Issue
Block a user