]> git.saurik.com Git - redis.git/commitdiff
redis-benchmark: seed the PRNG with time() at startup.
authorantirez <antirez@gmail.com>
Fri, 30 Nov 2012 14:41:09 +0000 (15:41 +0100)
committerantirez <antirez@gmail.com>
Fri, 30 Nov 2012 14:41:09 +0000 (15:41 +0100)
src/redis-benchmark.c

index 8d72573d5d5301b46ccdff94886eb59e2d1a209c..7ab700d3fcaffa9a9efe1dbfa039f663f0538b8e 100644 (file)
@@ -35,6 +35,7 @@
 #include <stdlib.h>
 #include <unistd.h>
 #include <errno.h>
+#include <time.h>
 #include <sys/time.h>
 #include <signal.h>
 #include <assert.h>
@@ -510,6 +511,7 @@ int main(int argc, const char **argv) {
 
     client c;
 
+    srandom(time(NULL));
     signal(SIGHUP, SIG_IGN);
     signal(SIGPIPE, SIG_IGN);