diff options
Diffstat (limited to 'src/redis-cli.c')
-rw-r--r-- | src/redis-cli.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/redis-cli.c b/src/redis-cli.c index 4f5b0fe03..31d2360c9 100644 --- a/src/redis-cli.c +++ b/src/redis-cli.c @@ -62,6 +62,7 @@ #include "anet.h" #include "ae.h" #include "cli_common.h" +#include "mt19937-64.h" #define UNUSED(V) ((void) V) @@ -5578,7 +5579,7 @@ static int clusterManagerCommandCreate(int argc, char **argv) { if (last > CLUSTER_MANAGER_SLOTS || i == (masters_count - 1)) last = CLUSTER_MANAGER_SLOTS - 1; if (last < first) last = first; - printf("Master[%d] -> Slots %lu - %lu\n", i, first, last); + printf("Master[%d] -> Slots %ld - %ld\n", i, first, last); master->slots_count = 0; for (j = first; j <= last; j++) { master->slots[j] = 1; @@ -7131,7 +7132,9 @@ static void getRDB(clusterManagerNode *node) { } else { fprintf(stderr,"Transfer finished with success.\n"); } - redisFree(s); /* Close the file descriptor ASAP as fsync() may take time. */ + redisFree(s); /* Close the connection ASAP as fsync() may take time. */ + if (node) + node->context = NULL; fsync(fd); close(fd); fprintf(stderr,"Transfer finished with success.\n"); @@ -8123,6 +8126,7 @@ static sds askPassword(const char *msg) { int main(int argc, char **argv) { int firstarg; + struct timeval tv; config.hostip = sdsnew("127.0.0.1"); config.hostport = 6379; @@ -8219,6 +8223,9 @@ int main(int argc, char **argv) { } #endif + gettimeofday(&tv, NULL); + init_genrand64(((long long) tv.tv_sec * 1000000 + tv.tv_usec) ^ getpid()); + /* Cluster Manager mode */ if (CLUSTER_MANAGER_MODE()) { clusterManagerCommandProc *proc = validateClusterManagerCommand(); |