[Asterisk-cvs] asterisk/res res_musiconhold.c,1.56,1.57

kpfleming at lists.digium.com kpfleming at lists.digium.com
Tue Apr 12 23:55:54 CDT 2005


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

Modified Files:
	res_musiconhold.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: res_musiconhold.c
===================================================================
RCS file: /usr/cvsroot/asterisk/res/res_musiconhold.c,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -d -r1.56 -r1.57
--- res_musiconhold.c	7 Apr 2005 14:53:31 -0000	1.56
+++ res_musiconhold.c	13 Apr 2005 04:47:39 -0000	1.57
@@ -169,10 +169,9 @@
 				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;




More information about the svn-commits mailing list