aboutsummaryrefslogtreecommitdiffstats
path: root/asterisk.c
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2005-05-16 03:04:59 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2005-05-16 03:04:59 +0000
commit71cd78c2e96d79c8392cf8f8320406f661ed30b8 (patch)
treebb39d5ebd7bb5ce406cbf6ce86b0dd834127c458 /asterisk.c
parentbad3c9dde4188c9183291c557c0bb270c97dbd41 (diff)
only initialize random number generators in one place (bug #4017)
git-svn-id: http://svn.digium.com/svn/asterisk/branches/v1-0@5694 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'asterisk.c')
-rwxr-xr-xasterisk.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/asterisk.c b/asterisk.c
index 146f43a71..0364f1b26 100755
--- a/asterisk.c
+++ b/asterisk.c
@@ -1824,6 +1824,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);