summaryrefslogtreecommitdiff
path: root/contrib/pgcrypto
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2008-02-17 02:09:32 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2008-02-17 02:09:32 +0000
commitcd004067742ee16ee63e55abfb4acbd5f09fbaab (patch)
tree62995d45f55faf5f5cdddc791d4d83d3de495b03 /contrib/pgcrypto
parentee7a6770f607e9e7f0e1b29dc25a7b7d63cb7940 (diff)
downloadpostgresql-cd004067742ee16ee63e55abfb4acbd5f09fbaab.tar.gz
Replace time_t with pg_time_t (same values, but always int64) in on-disk
data structures and backend internal APIs. This solves problems we've seen recently with inconsistent layout of pg_control between machines that have 32-bit time_t and those that have already migrated to 64-bit time_t. Also, we can get out from under the problem that Windows' Unix-API emulation is not consistent about the width of time_t. There are a few remaining places where local time_t variables are used to hold the current or recent result of time(NULL). I didn't bother changing these since they do not affect any cross-module APIs and surely all platforms will have 64-bit time_t before overflow becomes an actual risk. time_t should be avoided for anything visible to extension modules, however.
Diffstat (limited to 'contrib/pgcrypto')
-rw-r--r--contrib/pgcrypto/internal.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/contrib/pgcrypto/internal.c b/contrib/pgcrypto/internal.c
index 594308673b..56634aa32a 100644
--- a/contrib/pgcrypto/internal.c
+++ b/contrib/pgcrypto/internal.c
@@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $PostgreSQL: pgsql/contrib/pgcrypto/internal.c,v 1.27 2007/11/15 21:14:31 momjian Exp $
+ * $PostgreSQL: pgsql/contrib/pgcrypto/internal.c,v 1.28 2008/02/17 02:09:26 tgl Exp $
*/
#include "postgres.h"
@@ -649,7 +649,8 @@ system_reseed(void)
skip = 1;
else if ((t - seed_time) > SYSTEM_RESEED_MAX)
skip = 0;
- else if (!check_time || (t - check_time) > SYSTEM_RESEED_CHECK_TIME)
+ else if (check_time == 0 ||
+ (t - check_time) > SYSTEM_RESEED_CHECK_TIME)
{
check_time = t;