aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTatsuo Ishii <ishii@postgresql.org>2007-01-13 03:24:55 +0000
committerTatsuo Ishii <ishii@postgresql.org>2007-01-13 03:24:55 +0000
commitfe7b0fc35da752fead8c389a2a6cbb59f2aab92a (patch)
treedf0f3af2cc803a9ea127ea292d604f88b4008a26
parent2ece6917e8a434feeff03369ae2b4376c0212f49 (diff)
downloadpostgresql-fe7b0fc35da752fead8c389a2a6cbb59f2aab92a.tar.gz
postgresql-fe7b0fc35da752fead8c389a2a6cbb59f2aab92a.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.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/contrib/pgbench/pgbench.c b/contrib/pgbench/pgbench.c
index 398d2114300..27136665bb5 100644
--- a/contrib/pgbench/pgbench.c
+++ b/contrib/pgbench/pgbench.c
@@ -1,5 +1,5 @@
/*
- * $Header: /cvsroot/pgsql/contrib/pgbench/pgbench.c,v 1.27.2.2 2003/12/07 19:56:07 tgl Exp $
+ * $Header: /cvsroot/pgsql/contrib/pgbench/pgbench.c,v 1.27.2.3 2007/01/13 03:24:55 ishii Exp $
*
* pgbench: a simple TPC-B like benchmark program for PostgreSQL
* written by Tatsuo Ishii
@@ -935,7 +935,7 @@ main(int argc, char **argv)
/* set random seed */
gettimeofday(&tv1, 0);
- srand((uint) tv1.tv_usec);
+ srandom((uint) tv1.tv_usec);
/* get start up time */
gettimeofday(&tv1, 0);