X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Flibcollectdclient%2Fclient.c;h=0c748ba7fa47e3b30f1d2a8d5c30dffdfd70d3e3;hb=2a0b2294b8d0064890a2687d0ce25a8ed2f428f4;hp=501c729c143e53227a6256ace249295103136650;hpb=9ce08d6e5e67d89e29a21883bdca5b79d1f908a9;p=collectd.git diff --git a/src/libcollectdclient/client.c b/src/libcollectdclient/client.c index 501c729c..0c748ba7 100644 --- a/src/libcollectdclient/client.c +++ b/src/libcollectdclient/client.c @@ -116,7 +116,7 @@ typedef struct lcc_response_s lcc_response_t; /* Even though Posix requires "strerror_r" to return an "int", * some systems (e.g. the GNU libc) return a "char *" _and_ * ignore the second argument ... -tokkee */ -char *sstrerror (int errnum, char *buf, size_t buflen) +static char *sstrerror (int errnum, char *buf, size_t buflen) { buf[0] = 0; @@ -777,9 +777,9 @@ int lcc_putval (lcc_connection_t *c, const lcc_value_list_t *vl) /* {{{ */ SSTRCATF (command, " interval=%i", vl->interval); if (vl->time > 0) - SSTRCATF (command, "%u", (unsigned int) vl->time); + SSTRCATF (command, " %u", (unsigned int) vl->time); else - SSTRCAT (command, "N"); + SSTRCAT (command, " N"); for (i = 0; i < vl->values_len; i++) { @@ -792,6 +792,11 @@ int lcc_putval (lcc_connection_t *c, const lcc_value_list_t *vl) /* {{{ */ else SSTRCATF (command, ":%g", vl->values[i].gauge); } + else if (vl->values_types[i] == LCC_TYPE_DERIVE) + SSTRCATF (command, ":%"PRIu64, vl->values[i].derive); + else if (vl->values_types[i] == LCC_TYPE_ABSOLUTE) + SSTRCATF (command, ":%"PRIu64, vl->values[i].absolute); + } /* for (i = 0; i < vl->values_len; i++) */ status = lcc_sendreceive (c, command, &res);