Update of /usr/cvsroot/asterisk
In directory mongoose.digium.com:/tmp/cvs-serv6958

Modified Files:
        asterisk.c 
Log Message:
ensure that the random number generator(s) are always seeded with a different 
value during Asterisk startup
don't reinitialize random number generators in other modules
(bug #4017)


Index: asterisk.c
===================================================================
RCS file: /usr/cvsroot/asterisk/asterisk.c,v
retrieving revision 1.147
retrieving revision 1.148
diff -u -d -r1.147 -r1.148
--- asterisk.c  6 Apr 2005 21:12:32 -0000       1.147
+++ asterisk.c  13 Apr 2005 04:47:38 -0000      1.148
@@ -1922,6 +1922,12 @@
        signal(SIGCHLD, child_handler);
        signal(SIGPIPE, SIG_IGN);
 
+       /* ensure that the random number generators are seeded with a different 
value every time
+          Asterisk is started
+       */
+       srand((unsigned int) getpid() + (unsigned int) time(NULL));
+       srandom((unsigned int) getpid() + (unsigned int) time(NULL));
+
        if (init_logger()) {
                printf(term_quit());
                exit(1);

_______________________________________________
Asterisk-Cvs mailing list
[email protected]
http://lists.digium.com/mailman/listinfo/asterisk-cvs

Reply via email to