Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 810f2cf

Browse files
committed
Suppress compile warning, avoid possible problems with signed vs. unsigned
comparisons in recently-added CheckPointWarning code.
1 parent 38e6eb1 commit 810f2cf

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

src/backend/postmaster/postmaster.c

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
*
3838
*
3939
* IDENTIFICATION
40-
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.297 2002/11/15 02:44:55 momjian Exp $
40+
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.298 2002/11/18 00:40:46 tgl Exp $
4141
*
4242
* NOTES
4343
*
@@ -2338,12 +2338,17 @@ sigusr1_handler(SIGNAL_ARGS)
23382338
* segment files. Other checkpoints could reduce
23392339
* the frequency of forced checkpoints.
23402340
*/
2341-
time_t now = time(NULL);
2341+
time_t now = time(NULL);
23422342

2343-
if (now - LastSignalledCheckpoint < CheckPointWarning)
2344-
elog(LOG, "Checkpoint segments are being created too frequently (%d secs)\n
2345-
Consider increasing CHECKPOINT_SEGMENTS",
2346-
now - LastSignalledCheckpoint);
2343+
if (LastSignalledCheckpoint != 0)
2344+
{
2345+
int elapsed_secs = now - LastSignalledCheckpoint;
2346+
2347+
if (elapsed_secs < CheckPointWarning)
2348+
elog(LOG, "Checkpoint segments are being created too frequently (%d secs)"
2349+
"\n\tConsider increasing CHECKPOINT_SEGMENTS",
2350+
elapsed_secs);
2351+
}
23472352
LastSignalledCheckpoint = now;
23482353
}
23492354

0 commit comments

Comments
 (0)