Move srand call, seed from pid

This commit is contained in:
Steve Dee 2014-01-17 13:59:41 -08:00
parent 5a16660af1
commit 85085f713e
2 changed files with 3 additions and 3 deletions

View File

@ -279,10 +279,7 @@ u2_ames_io_init()
u2_ames* sam_u = &u2_Host.sam_u;
c3_s por_s;
srand(time(0)); // don't panic, only for fuzz testing
por_s = u2_Host.ops_u.por_s;
if ( 0 != u2_Host.ops_u.imp_c ) {
u2_noun imp = u2_ci_string(u2_Host.ops_u.imp_c);
u2_noun num = u2_dc("slaw", 'p', imp);

View File

@ -283,6 +283,9 @@ main(c3_i argc,
printf("Starting daemon\n");
}
// Seed prng. Don't panic -- just for fuzz testing and election timeouts.
srand(getpid());
// Instantiate process globals.
{
u2_wr_check_init(u2_Host.ops_u.cpu_c);