diff --git a/modules/ssl/ssl_engine_init.c b/modules/ssl/ssl_engine_init.c index b3008f3d9e..69b2eb9988 100644 --- a/modules/ssl/ssl_engine_init.c +++ b/modules/ssl/ssl_engine_init.c @@ -967,6 +967,9 @@ void ssl_init_Child(apr_pool_t *p, server_rec *s) SSLModConfigRec *mc = myModConfig(s); mc->pid = getpid(); /* only call getpid() once per-process */ + /* XXX: there should be an ap_srand() function */ + srand((unsigned int)time(NULL)); + /* open the mutex lockfile */ ssl_mutex_reinit(s, p); return; diff --git a/modules/ssl/ssl_engine_rand.c b/modules/ssl/ssl_engine_rand.c index 79a5a5171a..36a57bce05 100644 --- a/modules/ssl/ssl_engine_rand.c +++ b/modules/ssl/ssl_engine_rand.c @@ -203,7 +203,6 @@ static int ssl_rand_choosenum(int l, int h) int i; char buf[50]; - srand((unsigned int)time(NULL)); apr_snprintf(buf, sizeof(buf), "%.0f", (((double)(rand()%RAND_MAX)/RAND_MAX)*(h-l))); i = atoi(buf)+1;