77 * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
88 * Portions Copyright (c) 1994, Regents of the University of California
99 *
10- * $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.292 2008/01/21 11:17:46 petere Exp $
10+ * $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.293 2008/02/17 02:09:27 tgl Exp $
1111 *
1212 *-------------------------------------------------------------------------
1313 */
@@ -271,7 +271,7 @@ typedef struct XLogCtlWrite
271271{
272272 XLogwrtResult LogwrtResult ; /* current value of LogwrtResult */
273273 int curridx ; /* cache index of next block to write */
274- time_t lastSegSwitchTime ; /* time of last xlog segment switch */
274+ pg_time_t lastSegSwitchTime ; /* time of last xlog segment switch */
275275} XLogCtlWrite ;
276276
277277/*
@@ -1553,7 +1553,7 @@ XLogWrite(XLogwrtRqst WriteRqst, bool flexible, bool xlog_switch)
15531553 if (XLogArchivingActive ())
15541554 XLogArchiveNotifySeg (openLogId , openLogSeg );
15551555
1556- Write -> lastSegSwitchTime = time (NULL );
1556+ Write -> lastSegSwitchTime = ( pg_time_t ) time (NULL );
15571557
15581558 /*
15591559 * Signal bgwriter to start a checkpoint if we've consumed too
@@ -4217,7 +4217,7 @@ BootStrapXLOG(void)
42174217 checkPoint .nextOid = FirstBootstrapObjectId ;
42184218 checkPoint .nextMulti = FirstMultiXactId ;
42194219 checkPoint .nextMultiOffset = 0 ;
4220- checkPoint .time = time (NULL );
4220+ checkPoint .time = ( pg_time_t ) time (NULL );
42214221
42224222 ShmemVariableCache -> nextXid = checkPoint .nextXid ;
42234223 ShmemVariableCache -> nextOid = checkPoint .nextOid ;
@@ -4972,7 +4972,7 @@ StartupXLOG(void)
49724972 ControlFile -> checkPointCopy = checkPoint ;
49734973 if (minRecoveryLoc .xlogid != 0 || minRecoveryLoc .xrecoff != 0 )
49744974 ControlFile -> minRecoveryPoint = minRecoveryLoc ;
4975- ControlFile -> time = time (NULL );
4975+ ControlFile -> time = ( pg_time_t ) time (NULL );
49764976 UpdateControlFile ();
49774977
49784978 /*
@@ -5277,7 +5277,7 @@ StartupXLOG(void)
52775277 InRecovery = false;
52785278
52795279 ControlFile -> state = DB_IN_PRODUCTION ;
5280- ControlFile -> time = time (NULL );
5280+ ControlFile -> time = ( pg_time_t ) time (NULL );
52815281 UpdateControlFile ();
52825282
52835283 /* start the archive_timeout timer running */
@@ -5496,10 +5496,10 @@ GetInsertRecPtr(void)
54965496/*
54975497 * Get the time of the last xlog segment switch
54985498 */
5499- time_t
5499+ pg_time_t
55005500GetLastSegSwitchTime (void )
55015501{
5502- time_t result ;
5502+ pg_time_t result ;
55035503
55045504 /* Need WALWriteLock, but shared lock is sufficient */
55055505 LWLockAcquire (WALWriteLock , LW_SHARED );
@@ -5676,7 +5676,7 @@ CreateCheckPoint(int flags)
56765676 if (shutdown )
56775677 {
56785678 ControlFile -> state = DB_SHUTDOWNING ;
5679- ControlFile -> time = time (NULL );
5679+ ControlFile -> time = ( pg_time_t ) time (NULL );
56805680 UpdateControlFile ();
56815681 }
56825682
@@ -5690,7 +5690,7 @@ CreateCheckPoint(int flags)
56905690 /* Begin filling in the checkpoint WAL record */
56915691 MemSet (& checkPoint , 0 , sizeof (checkPoint ));
56925692 checkPoint .ThisTimeLineID = ThisTimeLineID ;
5693- checkPoint .time = time (NULL );
5693+ checkPoint .time = ( pg_time_t ) time (NULL );
56945694
56955695 /*
56965696 * We must hold WALInsertLock while examining insert state to determine
@@ -5891,7 +5891,7 @@ CreateCheckPoint(int flags)
58915891 ControlFile -> prevCheckPoint = ControlFile -> checkPoint ;
58925892 ControlFile -> checkPoint = ProcLastRecPtr ;
58935893 ControlFile -> checkPointCopy = checkPoint ;
5894- ControlFile -> time = time (NULL );
5894+ ControlFile -> time = ( pg_time_t ) time (NULL );
58955895 UpdateControlFile ();
58965896 LWLockRelease (ControlFileLock );
58975897
@@ -5992,7 +5992,7 @@ RecoveryRestartPoint(const CheckPoint *checkPoint)
59925992 * Checking true elapsed time keeps us from doing restartpoints too often
59935993 * while rapidly scanning large amounts of WAL.
59945994 */
5995- elapsed_secs = time (NULL ) - ControlFile -> time ;
5995+ elapsed_secs = ( pg_time_t ) time (NULL ) - ControlFile -> time ;
59965996 if (elapsed_secs < CheckPointTimeout / 2 )
59975997 return ;
59985998
@@ -6028,7 +6028,7 @@ RecoveryRestartPoint(const CheckPoint *checkPoint)
60286028 ControlFile -> prevCheckPoint = ControlFile -> checkPoint ;
60296029 ControlFile -> checkPoint = ReadRecPtr ;
60306030 ControlFile -> checkPointCopy = * checkPoint ;
6031- ControlFile -> time = time (NULL );
6031+ ControlFile -> time = ( pg_time_t ) time (NULL );
60326032 UpdateControlFile ();
60336033
60346034 ereport ((recoveryLogRestartpoints ? LOG : DEBUG2 ),
0 commit comments