X-Git-Url: https://git.octo.it/?p=rrdtool.git;a=blobdiff_plain;f=src%2Frrd_create.c;h=3b57c9f4d270f71ff37a3547d7fe99ea749781f9;hp=ffc1892c1106fdba91e2b9d2e13aa075bbbe9440;hb=9e6dd6a7c7768d90a8f62d7379d3dfa361e3ad7f;hpb=672a5d8877e055d90272210497302afb26e28c8f diff --git a/src/rrd_create.c b/src/rrd_create.c index ffc1892..3b57c9f 100644 --- a/src/rrd_create.c +++ b/src/rrd_create.c @@ -24,8 +24,6 @@ void parseGENERIC_DS( const char *def, rrd_t *rrd, int ds_idx); -long int rra_random_row( - rra_def_t *); static void rrd_free2( rrd_t *rrd); /* our onwn copy, immmune to mmap */ @@ -767,7 +765,7 @@ int rrd_create_fn( * would occur for cur_row = 1 because rrd_update increments * the pointer a priori. */ for (i = 0; i < rrd->stat_head->rra_cnt; i++) { - rrd->rra_ptr->cur_row = rra_random_row(&rrd->rra_def[i]); + rrd->rra_ptr->cur_row = rrd_select_initial_row(rrd_file_dn, i, &rrd->rra_def[i]); rrd_write(rrd_file_dn, rrd->rra_ptr, sizeof(rra_ptr_t)); } @@ -824,15 +822,3 @@ static void rrd_free2( free(rrd->rrd_value); } -static int rand_init = 0; - -long int rra_random_row( - rra_def_t *rra) -{ - if (!rand_init) { - srandom((unsigned int) time(NULL) + (unsigned int) getpid()); - rand_init++; - } - - return random() % rra->row_cnt; -}