Initialize random number generator in main

The random number generator can be initialized when MaxScale's other
systems are being initialized. This removes the need to initialized it
when the function is used for the first time.
This commit is contained in:
Markus Mäkelä
2017-02-08 16:42:35 +02:00
parent fdcc9333c8
commit 334e71b079
3 changed files with 50 additions and 58 deletions

View File

@ -67,6 +67,7 @@
#include <maxscale/thread.h>
#include <maxscale/utils.h>
#include <maxscale/version.h>
#include <maxscale/random_jkiss.h>
#include "maxscale/config.h"
#include "maxscale/maxscale.h"
@ -1666,6 +1667,9 @@ int main(int argc, char **argv)
goto return_main;
}
/** Initialize the random number generator */
random_jkiss_init();
if (!utils_init())
{
const char* logerr = "Failed to initialise utility library.";