mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-02 03:48:02 +00:00
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) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5459 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -1922,6 +1922,12 @@ int main(int argc, char *argv[])
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user