X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=random_selector.c;h=a9863d522ecf51edf63ec0ed35833b5bfe1405b4;hp=4c803d8459f2059fba58a489d6fe72da9c26262d;hb=ae0e4594c6a0312c5b4b4c0bde86f9c12253d11b;hpb=00f1ce3f3871c3148c74358e3bc9ae6f089c916a diff --git a/random_selector.c b/random_selector.c index 4c803d84..a9863d52 100644 --- a/random_selector.c +++ b/random_selector.c @@ -21,7 +21,7 @@ #include /* gettimeofday */ #include "server.cmdline.h" #include "server.h" -#include "db.h" +#include "afs.h" #include "error.h" #include "net.h" #include "string.h" @@ -106,7 +106,7 @@ out: return ret_list; } -void random_update_audio_file(char *audio_file) +static void random_update_audio_file(char *audio_file) { char *dn = para_dirname(audio_file); snprintf(mmd->selector_info, MMD_INFO_SIZE - 1, @@ -122,20 +122,23 @@ static void random_shutdown(void) } /** - * 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;