From 9576ab24dd1e21ef674f8d6b95de5055b3f8e1f9 Mon Sep 17 00:00:00 2001 From: Sascha Schumann Date: Wed, 18 Jul 2001 22:56:56 +0000 Subject: [PATCH] Instead of using the poor system rand() algorithm and the system-time seed, rely on the long-living LCG to determine whether to start the GC process. --- ext/session/session.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ext/session/session.c b/ext/session/session.c index 1248e6e02d..f709b6be2b 100644 --- a/ext/session/session.c +++ b/ext/session/session.c @@ -911,9 +911,8 @@ static void php_session_start(PSLS_D) if (PS(mod_data) && PS(gc_probability) > 0) { int nrdels = -1; - srand(time(NULL)); - nrand = (int) (100.0*rand()/RAND_MAX); - if (nrand < PS(gc_probability)) { + nrand = (int) (100.0*php_combined_lcg()); + if (nrand <= PS(gc_probability)) { PS(mod)->gc(&PS(mod_data), PS(gc_maxlifetime), &nrdels); #if 0 if (nrdels != -1) -- 2.50.1