--- ray/src/rt/rtmain.c 2006/02/05 22:22:20 2.13 +++ ray/src/rt/rtmain.c 2007/09/13 20:02:11 2.15 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: rtmain.c,v 2.13 2006/02/05 22:22:20 greg Exp $"; +static const char RCSid[] = "$Id: rtmain.c,v 2.15 2007/09/13 20:02:11 greg Exp $"; #endif /* * rtmain.c - main for rtrace per-ray calculation program @@ -227,8 +227,13 @@ main(int argc, char *argv[]) /* initialize object types */ initotypes(); /* initialize urand */ - initurand(2048); - srandom(rand_samp ? (long)time(0) : 0L); + if (rand_samp) { + srandom((long)time(0)); + initurand(0); + } else { + srandom(0L); + initurand(2048); + } /* set up signal handling */ sigdie(SIGINT, "Interrupt"); #ifdef SIGHUP @@ -304,10 +309,11 @@ main(int argc, char *argv[]) while ((rval=fork()) == 0) { /* keep on forkin' */ pflock(1); pfhold(); + ambsync(); /* load new values */ } if (rval < 0) error(SYSTEM, "cannot fork child for persist function"); - pfdetach(); /* parent exits */ + pfdetach(); /* parent will run then exit */ } } runagain: