From: Tatsuo Ishii Date: Wed, 10 Jan 2007 01:44:30 +0000 (+0000) Subject: Back port patch. X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=7f334bbcabbfd176d0bacd72524b43093883affd;p=users%2Fbernd%2Fpostgres.git 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. --- diff --git a/contrib/pgbench/pgbench.c b/contrib/pgbench/pgbench.c index 3b6e68ad87..b0c76e2510 100644 --- a/contrib/pgbench/pgbench.c +++ b/contrib/pgbench/pgbench.c @@ -4,7 +4,7 @@ * 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);