Hi,

As the src code in https://github.com/redis/redis/blob/unstable/src/server.c#L6941-L6943.

I have little questions for help:

  • why should we depend on both of rand(...) and radom(...), shall we just select one of them
  • is it necessary to call time(...) cuz we have got the value of time in seconds via gettimeofday(...), maybe we could save the of cost of calling time(...)

to be short, the expect as below:

gettimeofday(&tv,NULL);
srandom(tv.tv_sec^getpid()^tv.tv_usec);

or

gettimeofday(&tv,NULL);
srandom((tv.tv_sec*1000000+tv.tv_usec)^getpid());

i don't konw if it is okay.