Added time.h include in redis-cli.
authorantirez <antirez@gmail.com>
Mon, 14 May 2012 15:35:51 +0000 (17:35 +0200)
committerantirez <antirez@gmail.com>
Mon, 14 May 2012 15:43:31 +0000 (17:43 +0200)
redis-cli.c uses the time() function to seed the PRNG, but time.h was
not included. This was not noticed since sys/time.h is included and was
enough in most systems (but not correct). With Ubuntu 12.04 GCC
generates a warning that made us aware of the issue.

src/redis-cli.c

index ca2f06233dcaea270613e6110ce43fa312306cf2..f485587957dea102bda72243f4273dbae10702e4 100644 (file)
@@ -35,6 +35,7 @@
 #include <string.h>
 #include <stdlib.h>
 #include <unistd.h>
+#include <time.h>
 #include <ctype.h>
 #include <errno.h>
 #include <sys/stat.h>