Fixed compile errors.

git-svn-id: https://svn.code.sf.net/p/flaim/code/trunk@596 0109f412-320b-0410-ab79-c3e0c5ffbbe6
This commit is contained in:
ahodgkinson
2006-06-20 22:04:21 +00:00
parent 1aea353f19
commit 2587e19e4e
2 changed files with 84 additions and 19 deletions

View File

@@ -151,10 +151,10 @@ RCODE F_DbSystem::copyDb(
{
RCODE rc = NE_XFLM_OK;
DB_COPY_INFO DbCopyInfo;
F_SuperFileHdl SrcSFileHdl;
F_SuperFileHdl DestSFileHdl;
F_SuperFileClient SrcSFileClient;
F_SuperFileClient DestSFileClient;
F_SuperFileHdl * pSrcSFileHdl = NULL;
F_SuperFileHdl * pDestSFileHdl = NULL;
F_SuperFileClient * pSrcSFileClient = NULL;
F_SuperFileClient * pDestSFileClient = NULL;
FLMUINT uiFileNumber;
FLMUINT uiHighFileNumber;
FLMUINT uiHighLogFileNumber;
@@ -210,13 +210,25 @@ RCODE F_DbSystem::copyDb(
// Set up the super file object for the source database.
// Must at least open the control file.
if( (pSrcSFileClient = f_new F_SuperFileClient) == NULL)
{
rc = RC_SET( NE_XFLM_MEM);
goto Exit;
}
if( RC_BAD( rc = SrcSFileClient.setup( pszSrcDbName, pszSrcDataDir)))
if( RC_BAD( rc = pSrcSFileClient->setup( pszSrcDbName, pszSrcDataDir)))
{
goto Exit;
}
if (RC_BAD( rc = SrcSFileHdl.setup( &SrcSFileClient)))
if( (pSrcSFileHdl = f_new F_SuperFileHdl) == NULL)
{
rc = RC_SET( NE_XFLM_MEM);
goto Exit;
}
if (RC_BAD( rc = pSrcSFileHdl->setup( pSrcSFileClient)))
{
goto Exit;
}
@@ -322,13 +334,25 @@ retry:
}
// Set up the super file object for the destination database.
if( (pDestSFileClient = f_new F_SuperFileClient) == NULL)
{
rc = RC_SET( NE_XFLM_MEM);
goto Exit;
}
if( RC_BAD( rc = DestSFileClient.setup( pszDestDbName, pszDestDataDir)))
if( RC_BAD( rc = pDestSFileClient->setup( pszDestDbName, pszDestDataDir)))
{
goto Exit;
}
if (RC_BAD( rc = DestSFileHdl.setup( &DestSFileClient)))
if( (pDestSFileHdl = f_new F_SuperFileHdl) == NULL)
{
rc = RC_SET( NE_XFLM_MEM);
goto Exit;
}
if (RC_BAD( rc = pDestSFileHdl->setup( pDestSFileClient)))
{
goto Exit;
}
@@ -338,7 +362,7 @@ retry:
uiHighFileNumber = 0;
for (;;)
{
if ((RC_BAD( rc = SrcSFileHdl.getFileSize(
if ((RC_BAD( rc = pSrcSFileHdl->getFileSize(
uiHighFileNumber, &ui64FileSize))) || !ui64FileSize )
{
if (rc == NE_FLM_IO_PATH_NOT_FOUND ||
@@ -373,7 +397,7 @@ retry:
uiHighLogFileNumber = FIRST_LOG_BLOCK_FILE_NUMBER;
for (;;)
{
if ((RC_BAD( rc = SrcSFileHdl.getFileSize(
if ((RC_BAD( rc = pSrcSFileHdl->getFileSize(
uiHighLogFileNumber, &ui64FileSize))) || !ui64FileSize)
{
if (rc == NE_FLM_IO_PATH_NOT_FOUND ||
@@ -445,8 +469,8 @@ retry:
// Close all file handles in the source and destination
SrcSFileHdl.releaseFiles( TRUE);
DestSFileHdl.releaseFiles( TRUE);
pSrcSFileHdl->releaseFiles( TRUE);
pDestSFileHdl->releaseFiles( TRUE);
// Copy the database files.
@@ -455,12 +479,12 @@ retry:
// Get the source file path and destination file path.
if( RC_BAD( rc = SrcSFileHdl.getFilePath(
if( RC_BAD( rc = pSrcSFileHdl->getFilePath(
uiFileNumber, DbCopyInfo.szSrcFileName)))
{
goto Exit;
}
if( RC_BAD( rc = DestSFileHdl.getFilePath(
if( RC_BAD( rc = pDestSFileHdl->getFilePath(
uiFileNumber, DbCopyInfo.szDestFileName)))
{
goto Exit;
@@ -482,13 +506,13 @@ retry:
// Get the source file path and destination file path.
if (RC_BAD( rc = SrcSFileHdl.getFilePath( uiFileNumber,
if (RC_BAD( rc = pSrcSFileHdl->getFilePath( uiFileNumber,
DbCopyInfo.szSrcFileName)))
{
goto Exit;
}
if (RC_BAD( rc = DestSFileHdl.getFilePath( uiFileNumber,
if (RC_BAD( rc = pDestSFileHdl->getFilePath( uiFileNumber,
DbCopyInfo.szDestFileName)))
{
goto Exit;
@@ -700,6 +724,26 @@ Exit:
f_semDestroy( &hWaitSem);
}
if( pSrcSFileClient)
{
pSrcSFileClient->Release();
}
if( pSrcSFileHdl)
{
pSrcSFileHdl->Release();
}
if( pDestSFileClient)
{
pDestSFileClient->Release();
}
if( pDestSFileHdl)
{
pDestSFileHdl->Release();
}
return( rc);
}