#include <sys/time.h> /* gettimeofday */
#include "server.cmdline.h"
#include "server.h"
-#include "db.h"
+#include "afs.h"
#include "error.h"
#include "net.h"
#include "string.h"
}
/**
- * the init function for the random audio file selector
+ * the init function for the random audio file selector
*
- * Init all function pointers of \a s, init the info text and seed the
- * PRNG.
+ * \param s pointer ro the struct to iniitalize
+ *
+ * Init all function pointers of \a s, init the info text and seed the PRNG.
*
* \sa struct audio_file_selector, misc_meta_data::selector_info, mysql.c
*/
int random_selector_init(struct audio_file_selector *s)
{
struct timeval now;
+ unsigned int seed;
PARA_INFO_LOG("%s", "registering random handlers ;)\n");
gettimeofday(&now, NULL);
- srand(now.tv_usec);
+ seed = now.tv_usec;
+ srand(seed);
s->cmd_list = random_selector_cmds;
s->get_audio_file_list = random_get_audio_file_list;
s->shutdown = random_shutdown;