X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Frrdtool.c;h=348f28762c364d03b527cb9b04bfc71b54c69533;hb=3fae5596643f1e361eb18c3d65448f8bc02fdd80;hp=b45f8d997fc4b7acb2882b645eebfb519a3b22b2;hpb=8361c1e963f9184c3c4d87197fd6996d667cdb3f;p=collectd.git diff --git a/src/rrdtool.c b/src/rrdtool.c index b45f8d99..348f2876 100644 --- a/src/rrdtool.c +++ b/src/rrdtool.c @@ -32,10 +32,6 @@ #include -#if HAVE_PTHREAD_H -# include -#endif - /* * Private types */ @@ -588,7 +584,7 @@ static void rrd_cache_flush (cdtime_t timeout) } else /* ancient and no values -> waste of memory */ { - char **tmp = (char **) realloc ((void *) keys, + char **tmp = realloc (keys, (keys_num + 1) * sizeof (char *)); if (tmp == NULL) { @@ -692,7 +688,7 @@ static int64_t rrd_get_random_variation (void) long min; long max; - if (random_timeout <= 0) + if (random_timeout == 0) return (0); /* Assure that "cache_timeout + random_variation" is never negative. */ @@ -756,7 +752,7 @@ static int rrd_cache_insert (const char *filename, return (-1); } - values_new = (char **) realloc ((void *) rc->values, + values_new = realloc ((void *) rc->values, (rc->values_num + 1) * sizeof (char *)); if (values_new == NULL) {