diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2012-11-18 16:16:39 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2012-11-18 16:16:39 -0500 |
commit | d038966ddb918872700f9f21affbc84d6bc2c029 (patch) | |
tree | 0f5ab531fe6eaee4ffb3a0f8039ff3909db81a54 /src/backend/utils/misc/guc.c | |
parent | 14ddff44c22cb358775d5aad6953f0ce0fdb64cf (diff) | |
download | postgresql-d038966ddb918872700f9f21affbc84d6bc2c029.tar.gz postgresql-d038966ddb918872700f9f21affbc84d6bc2c029.zip |
Fix syslogger to not fail when log_rotation_age exceeds 2^31 milliseconds.
We need to avoid calling WaitLatch with timeouts exceeding INT_MAX.
Fortunately a simple clamp will do the trick, since no harm is done if
the wait times out before it's really time to rotate the log file.
Per bug #7670 (probably bug #7545 is the same thing, too).
In passing, fix bogus definition of log_rotation_age's maximum value in
guc.c --- it was numerically right, but only because MINS_PER_HOUR and
SECS_PER_MINUTE have the same value.
Back-patch to 9.2. Before that, syslogger wasn't using WaitLatch.
Diffstat (limited to 'src/backend/utils/misc/guc.c')
-rw-r--r-- | src/backend/utils/misc/guc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c index 745e7be68e4..54461c830fe 100644 --- a/src/backend/utils/misc/guc.c +++ b/src/backend/utils/misc/guc.c @@ -2147,7 +2147,7 @@ static struct config_int ConfigureNamesInt[] = GUC_UNIT_MIN }, &Log_RotationAge, - HOURS_PER_DAY * MINS_PER_HOUR, 0, INT_MAX / MINS_PER_HOUR, + HOURS_PER_DAY * MINS_PER_HOUR, 0, INT_MAX / SECS_PER_MINUTE, NULL, NULL, NULL }, |