summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1dd26cb)
raw | patch | inline | side by side (parent: 1dd26cb)
author | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Mon, 18 Feb 2008 19:41:38 +0000 (20:41 +0100) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Mon, 18 Feb 2008 19:41:38 +0000 (20:41 +0100) |
This is required by the logic calculating the RRA sized.
src/rrdtool.c | patch | blob | history |
diff --git a/src/rrdtool.c b/src/rrdtool.c
index 79331bf73dce12a6660c29f032af29f283463b79..843aa2bfd16849d7c21a7f3c779931e2bb5eb40b 100644 (file)
--- a/src/rrdtool.c
+++ b/src/rrdtool.c
return (0);
} /* int rrd_cache_insert */
+static int rrd_compare_numeric (const void *a_ptr, const void *b_ptr)
+{
+ int a = *((int *) a_ptr);
+ int b = *((int *) b_ptr);
+
+ if (a < b)
+ return (-1);
+ else if (a > b)
+ return (1);
+ else
+ return (0);
+} /* int rrd_compare_numeric */
+
static int rrd_write (const data_set_t *ds, const value_list_t *vl)
{
struct stat statbuf;
if (rra_timespans_custom[rra_timespans_custom_num] != 0)
rra_timespans_custom_num++;
} /* while (strtok_r) */
+
+ qsort (/* base = */ rra_timespans_custom,
+ /* nmemb = */ rra_timespans_custom_num,
+ /* size = */ sizeof (rra_timespans_custom[0]),
+ /* compar = */ rrd_compare_numeric);
+
free (value_copy);
}
else if (strcasecmp ("XFF", key) == 0)