diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-04-13 04:47:39 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-04-13 04:47:39 +0000 |
commit | 7da33e49f47b232b1f8c5f8099541629fbc1e2ea (patch) | |
tree | e1aeac46df33ad6eda3039636b8939aaf48d71a4 /res/res_musiconhold.c | |
parent | 0ec2431168fa927330180da2c8511cf740ade3f0 (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: http://svn.digium.com/svn/asterisk/trunk@5459 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res/res_musiconhold.c')
-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; |