From a75dbcecc0c7aca9f839534dfe6dd41b0b143bc0 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Sat, 13 Jan 2007 18:22:49 +0100 Subject: [PATCH 1/1] rrdtool plugin: Use the time supplied by the value list, not `N'. --- src/rrdtool.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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) -- 2.11.0