aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTatsuo Ishii <ishii@postgresql.org>2007-01-10 01:44:30 +0000
committerTatsuo Ishii <ishii@postgresql.org>2007-01-10 01:44:30 +0000
commite6be37ffe2ca736378c9c4608ee8f8b2e11189b9 (patch)
tree6e818f9301a10d7a939eff8089844f5a81527ae9
parentc3013376b25bf9423c6783b74e813aa47b99b39e (diff)
downloadpostgresql-e6be37ffe2ca736378c9c4608ee8f8b2e11189b9.tar.gz
postgresql-e6be37ffe2ca736378c9c4608ee8f8b2e11189b9.zip
Back port patch.
Call srandom() instead of srand(). pgbench calls random() later, so it should have called srandom(). On most platforms except Windows srandom() is actually identical to srand(), so the bug only bites Windows users. per bug report from Akio Ishida.
-rw-r--r--contrib/pgbench/pgbench.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/contrib/pgbench/pgbench.c b/contrib/pgbench/pgbench.c
index 50164a762e7..ee659832eec 100644
--- a/contrib/pgbench/pgbench.c
+++ b/contrib/pgbench/pgbench.c
@@ -1,10 +1,10 @@
/*
- * $PostgreSQL: pgsql/contrib/pgbench/pgbench.c,v 1.45.2.4 2005/12/10 01:09:14 tgl Exp $
+ * $PostgreSQL: pgsql/contrib/pgbench/pgbench.c,v 1.45.2.5 2007/01/10 01:44:30 ishii Exp $
*
* pgbench: a simple benchmark program for PostgreSQL
* written by Tatsuo Ishii
*
- * Copyright (c) 2000-2005 Tatsuo Ishii
+ * Copyright (c) 2000-2007 Tatsuo Ishii
*
* Permission to use, copy, modify, and distribute this software and
* its documentation for any purpose and without fee is hereby
@@ -1296,7 +1296,7 @@ main(int argc, char **argv)
/* set random seed */
gettimeofday(&tv1, NULL);
- srand((unsigned int) tv1.tv_usec);
+ srandom((unsigned int) tv1.tv_usec);
/* get start up time */
gettimeofday(&tv1, NULL);