@ -95,7 +95,6 @@ main(int argc, char *argv[])
char mock_auth_nonce_str [ MOCK_AUTH_NONCE_LEN * 2 + 1 ] ;
char mock_auth_nonce_str [ MOCK_AUTH_NONCE_LEN * 2 + 1 ] ;
const char * strftime_fmt = " %c " ;
const char * strftime_fmt = " %c " ;
const char * progname ;
const char * progname ;
XLogSegNo segno ;
char xlogfilename [ MAXFNAMELEN ] ;
char xlogfilename [ MAXFNAMELEN ] ;
int c ;
int c ;
int i ;
int i ;
@ -169,10 +168,11 @@ main(int argc, char *argv[])
WalSegSz = ControlFile - > xlog_seg_size ;
WalSegSz = ControlFile - > xlog_seg_size ;
if ( ! IsValidWalSegSize ( WalSegSz ) )
if ( ! IsValidWalSegSize ( WalSegSz ) )
fprintf ( stderr ,
printf ( _ ( " WARNING: invalid WAL segment size \n "
_ ( " WARNING: WAL segment size specified, %d bytes, is not a power of two between 1MB and 1GB. \n "
" The WAL segment size stored in the file, %d bytes, is not a power of two \n "
" The file is corrupt and the results below are untrustworthy. \n " ) ,
" between 1 MB and 1 GB. The file is corrupt and the results below are \n "
WalSegSz ) ;
" untrustworthy. \n \n " ) ,
WalSegSz ) ;
/*
/*
* This slightly - chintzy coding will work as long as the control file
* This slightly - chintzy coding will work as long as the control file
@ -193,10 +193,20 @@ main(int argc, char *argv[])
/*
/*
* Calculate name of the WAL file containing the latest checkpoint ' s REDO
* Calculate name of the WAL file containing the latest checkpoint ' s REDO
* start point .
* start point .
*
* A corrupted control file could report a WAL segment size of 0 , and to
* guard against division by zero , we need to treat that specially .
*/
*/
XLByteToSeg ( ControlFile - > checkPointCopy . redo , segno , WalSegSz ) ;
if ( WalSegSz ! = 0 )
XLogFileName ( xlogfilename , ControlFile - > checkPointCopy . ThisTimeLineID ,
{
segno , WalSegSz ) ;
XLogSegNo segno ;
XLByteToSeg ( ControlFile - > checkPointCopy . redo , segno , WalSegSz ) ;
XLogFileName ( xlogfilename , ControlFile - > checkPointCopy . ThisTimeLineID ,
segno , WalSegSz ) ;
}
else
strcpy ( xlogfilename , _ ( " ??? " ) ) ;
/*
/*
* Format system_identifier and mock_authentication_nonce separately to
* Format system_identifier and mock_authentication_nonce separately to