diff options
author | Kevin P. Fleming <kpfleming@digium.com> | 2005-04-13 04:47:39 +0000 |
---|---|---|
committer | Kevin P. Fleming <kpfleming@digium.com> | 2005-04-13 04:47:39 +0000 |
commit | b052fe894bbcece8d93cc55327cf99455cc773cf (patch) | |
tree | e1aeac46df33ad6eda3039636b8939aaf48d71a4 /res | |
parent | 18e2c2e4683c15e6dd7926f1d0c64ffadd42f86b (diff) |
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
Diffstat (limited to 'res')
-rwxr-xr-x | res/res_musiconhold.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/res/res_musiconhold.c b/res/res_musiconhold.c index ac6c0d54d..6ba33b3ca 100755 --- a/res/res_musiconhold.c +++ b/res/res_musiconhold.c @@ -169,10 +169,9 @@ static int ast_moh_files_next(struct ast_channel *chan) state->pos++; } - if (ast_test_flag(state->class, MOH_RANDOMIZE)) { - srand(time(NULL)+getpid()+strlen(chan->name)-state->class->total_files); + if (ast_test_flag(state->class, MOH_RANDOMIZE)) state->pos = rand(); - } + /* check to see if this file's format can be opened */ if (ast_fileexists(state->class->filearray[state->pos], NULL, NULL) != -1) break; |