summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTatsuo Ishii <ishii@postgresql.org>2007-01-13 03:17:34 +0000
committerTatsuo Ishii <ishii@postgresql.org>2007-01-13 03:17:34 +0000
commit8147c13f6fc04f9c929d03cbb5402f1977a07458 (patch)
tree9e3f6951b0d923061b7a4198f42a0cc66f98ae79
parenta7542c3bb1d0fc59856c8152735722afb8c9a1c2 (diff)
downloadpostgresql-8147c13f6fc04f9c929d03cbb5402f1977a07458.tar.gz
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 6b4aaec63e..806ea801d1 100644
--- a/contrib/pgbench/pgbench.c
+++ b/contrib/pgbench/pgbench.c
@@ -1,10 +1,10 @@
/*
- * $PostgreSQL: pgsql/contrib/pgbench/pgbench.c,v 1.35 2004/11/09 06:09:31 neilc Exp $
+ * $PostgreSQL: pgsql/contrib/pgbench/pgbench.c,v 1.35.4.1 2007/01/13 03:17:34 ishii Exp $
*
* pgbench: a simple TPC-B like benchmark program for PostgreSQL
* written by Tatsuo Ishii
*
- * Copyright (c) 2000-2004 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
@@ -939,7 +939,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);