From: Florian Forster Date: Sat, 13 Jan 2007 17:22:49 +0000 (+0100) Subject: rrdtool plugin: Use the time supplied by the value list, not `N'. X-Git-Tag: collectd-4.0.0~240 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=a75dbcecc0c7aca9f839534dfe6dd41b0b143bc0;p=collectd.git rrdtool plugin: Use the time supplied by the value list, not `N'. --- diff --git a/src/rrdtool.c b/src/rrdtool.c index 96eee579..86cd4e2f 100644 --- a/src/rrdtool.c +++ b/src/rrdtool.c @@ -305,8 +305,11 @@ static int value_list_to_string (char *buffer, int buffer_len, int i; memset (buffer, '\0', sizeof (buffer_len)); - buffer[0] = 'N'; - offset = 1; + + status = snprintf (buffer, buffer_len, "%u", (unsigned int) vl->time); + if ((status < 1) || (status >= buffer_len)) + return (-1); + offset = status; for (i = 0; i < ds->ds_num; i++) { @@ -399,6 +402,8 @@ static int rrd_write (const data_set_t *ds, const value_list_t *vl) return (-1); } + DBG ("rrd_update (%s, %s, %s)", argv[0], argv[1], argv[2]); + optind = 0; /* bug in librrd? */ rrd_clear_error (); if (rrd_update (3, argv) == -1)