Back port patch.
authorTatsuo Ishii <[email protected]>
Sat, 13 Jan 2007 03:24:55 +0000 (03:24 +0000)
committerTatsuo Ishii <[email protected]>
Sat, 13 Jan 2007 03:24:55 +0000 (03:24 +0000)
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.

contrib/pgbench/pgbench.c

index 9a14e1501bd7af160edb31e610a9f89a42ab81a5..3dec7cfd27c91989d5ff40cc20ee6ee33c779297 100644 (file)
@@ -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);