diff options
author | Tatsuo Ishii <ishii@postgresql.org> | 2007-01-10 01:20:10 +0000 |
---|---|---|
committer | Tatsuo Ishii <ishii@postgresql.org> | 2007-01-10 01:20:10 +0000 |
commit | 9c505e484cbb06bb7d688c86e3d0c54d49414f27 (patch) | |
tree | fd0fb7dcc2ab6beb3879d596eca93998cb7c75b9 | |
parent | 757dfd6327b6abeb592aef8c689d59faf6b3f82e (diff) | |
download | postgresql-9c505e484cbb06bb7d688c86e3d0c54d49414f27.tar.gz postgresql-9c505e484cbb06bb7d688c86e3d0c54d49414f27.zip |
Backport 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.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/contrib/pgbench/pgbench.c b/contrib/pgbench/pgbench.c index e880f638f06..cb92c2fbc7d 100644 --- a/contrib/pgbench/pgbench.c +++ b/contrib/pgbench/pgbench.c @@ -1,10 +1,10 @@ /* - * $PostgreSQL: pgsql/contrib/pgbench/pgbench.c,v 1.58 2006/10/21 06:31:28 ishii Exp $ + * $PostgreSQL: pgsql/contrib/pgbench/pgbench.c,v 1.58.2.1 2007/01/10 01:20:10 ishii Exp $ * * pgbench: a simple benchmark program for PostgreSQL * written by Tatsuo Ishii * - * Copyright (c) 2000-2006 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 @@ -1500,7 +1500,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); |