X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Flibcollectdclient%2Fclient.c;h=9ad61f6410a28db3331738147dd534beb72cf8b1;hb=ca316d91e178412604ea8462dc60a8bc32cbfc87;hp=850edaaff45841d82c1a7536258e26a74d9229a1;hpb=499cbd1605850e0feca405fb2579064d330eea8f;p=collectd.git diff --git a/src/libcollectdclient/client.c b/src/libcollectdclient/client.c index 850edaaf..9ad61f64 100644 --- a/src/libcollectdclient/client.c +++ b/src/libcollectdclient/client.c @@ -84,7 +84,7 @@ _b[sizeof (_b) - 1] = 0; \ SSTRCAT ((d), _b); \ } while (0) - + #define LCC_SET_ERRSTR(c, ...) do { \ snprintf ((c)->errbuf, sizeof ((c)->errbuf), __VA_ARGS__); \ @@ -258,6 +258,7 @@ static int lcc_send (lcc_connection_t *c, const char *command) /* {{{ */ lcc_set_errno (c, errno); return (-1); } + fflush(c->fh); return (0); } /* }}} int lcc_send */ @@ -767,11 +768,11 @@ int lcc_putval (lcc_connection_t *c, const lcc_value_list_t *vl) /* {{{ */ SSTRCATF (command, "PUTVAL %s", lcc_strescape (ident_esc, ident_str, sizeof (ident_esc))); - if (vl->interval > 0) - SSTRCATF (command, " interval=%i", vl->interval); + if (vl->interval > 0.0) + SSTRCATF (command, " interval=%.3f", vl->interval); - if (vl->time > 0) - SSTRCATF (command, " %u", (unsigned int) vl->time); + if (vl->time > 0.0) + SSTRCATF (command, " %.3f", vl->time); else SSTRCAT (command, " N");