aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2002-11-18 00:40:46 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2002-11-18 00:40:46 +0000
commit810f2cfa3298e6535631eb4ea1b42fc83f253b1d (patch)
tree76945ab16b0e01595ac640c3e892ad604ac260d6 /src
parent38e6eb197d87fc815c88c1caf79cd4cd8887272e (diff)
downloadpostgresql-810f2cfa3298e6535631eb4ea1b42fc83f253b1d.tar.gz
postgresql-810f2cfa3298e6535631eb4ea1b42fc83f253b1d.zip
Suppress compile warning, avoid possible problems with signed vs. unsigned
comparisons in recently-added CheckPointWarning code.
Diffstat (limited to 'src')
-rw-r--r--src/backend/postmaster/postmaster.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c
index 53aa731e719..187f0191c94 100644
--- a/src/backend/postmaster/postmaster.c
+++ b/src/backend/postmaster/postmaster.c
@@ -37,7 +37,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.297 2002/11/15 02:44:55 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.298 2002/11/18 00:40:46 tgl Exp $
*
* NOTES
*
@@ -2338,12 +2338,17 @@ sigusr1_handler(SIGNAL_ARGS)
* segment files. Other checkpoints could reduce
* the frequency of forced checkpoints.
*/
- time_t now = time(NULL);
+ time_t now = time(NULL);
- if (now - LastSignalledCheckpoint < CheckPointWarning)
- elog(LOG, "Checkpoint segments are being created too frequently (%d secs)\n
- Consider increasing CHECKPOINT_SEGMENTS",
- now - LastSignalledCheckpoint);
+ if (LastSignalledCheckpoint != 0)
+ {
+ int elapsed_secs = now - LastSignalledCheckpoint;
+
+ if (elapsed_secs < CheckPointWarning)
+ elog(LOG, "Checkpoint segments are being created too frequently (%d secs)"
+ "\n\tConsider increasing CHECKPOINT_SEGMENTS",
+ elapsed_secs);
+ }
LastSignalledCheckpoint = now;
}