Set the initial seed for random() (#5679)

This commit is contained in:
RemRain 2020-08-13 04:15:58 +08:00 committed by GitHub
parent 70c823a64e
commit 8736ac973a

View File

@ -5135,6 +5135,7 @@ int main(int argc, char **argv) {
tzset(); /* Populates 'timezone' global. */
zmalloc_set_oom_handler(redisOutOfMemoryHandler);
srand(time(NULL)^getpid());
srandom(time(NULL)^getpid());
gettimeofday(&tv,NULL);
crc64_init();