From cbeb9d829b025428d910956f3d6208e7886582cd Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Mon, 18 Jul 2022 01:05:01 -0700 Subject: modules/rtv: s/rand/rand_r/ just fixing up some vestigial rand() invocations to use the seed --- src/modules/rtv/rtv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/modules/rtv') diff --git a/src/modules/rtv/rtv.c b/src/modules/rtv/rtv.c index 9714368..c90a824 100644 --- a/src/modules/rtv/rtv.c +++ b/src/modules/rtv/rtv.c @@ -106,7 +106,7 @@ static int cmp_channels(const void *p1, const void *p2) static void randomize_channels(rtv_context_t *ctxt) { for (size_t i = 0; i < ctxt->n_channels; i++) - ctxt->channels[i].order = rand(); + ctxt->channels[i].order = rand_r(&ctxt->til_module_context.seed); qsort(ctxt->channels, ctxt->n_channels, sizeof(rtv_channel_t), cmp_channels); } @@ -188,7 +188,7 @@ static void setup_next_channel(rtv_context_t *ctxt, unsigned ticks) } if (!ctxt->channel->module_ctxt) - (void) til_module_create_context(ctxt->channel->module, rand(), ticks, 0, ctxt->channel->module_setup, &ctxt->channel->module_ctxt); + (void) til_module_create_context(ctxt->channel->module, rand_r(&ctxt->til_module_context.seed), ticks, 0, ctxt->channel->module_setup, &ctxt->channel->module_ctxt); ctxt->channel->last_on_time = now; } -- cgit v1.2.1