From: Andrew Rodland Date: Fri, 21 Nov 2014 02:57:10 +0000 (-0500) Subject: Have child processes srand on startup. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FFCGI-ProcManager.git;a=commitdiff_plain;h=7edfbf2711576d4d23656fe268f384dadae34f8b Have child processes srand on startup. This makes sure that each child has independent random numbers even if someone called rand() before the fork. Starman does this, and it's a good idea. --- diff --git a/lib/FCGI/ProcManager.pm b/lib/FCGI/ProcManager.pm index 93ed425..e5b0fbc 100644 --- a/lib/FCGI/ProcManager.pm +++ b/lib/FCGI/ProcManager.pm @@ -456,6 +456,10 @@ sub handling_init { # change the name of this process as it appears in ps(1) output. $this->pm_change_process_name("perl-fcgi"); + + # Re-srand in case someone called rand before the fork, so that + # children get different random numbers. + srand; } =head2 pm_pre_dispatch