Bug 5961 - new RAND() function

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@7920 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Tilghman Lesher
2006-01-10 00:55:45 +00:00
parent 662c9aeb23
commit 935c80d5e6
4 changed files with 165 additions and 1 deletions

View File

@@ -211,6 +211,8 @@ static int shuttingdown = 0;
static int restartnow = 0;
static pthread_t consolethread = AST_PTHREADT_NULL;
static char randompool[256];
#if !defined(LOW_MEMORY)
struct file_version {
AST_LIST_ENTRY(file_version) list;
@@ -2288,7 +2290,7 @@ int main(int argc, char *argv[])
Asterisk is started
*/
srand((unsigned int) getpid() + (unsigned int) time(NULL));
srandom((unsigned int) getpid() + (unsigned int) time(NULL));
initstate((unsigned int) getpid() * 65536 + (unsigned int) time(NULL), randompool, sizeof(randompool));
if (init_logger()) {
printf(term_quit());