projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
bindings/java/Makefile.am: Fix rebuilding of Java plugins.
[collectd.git]
/
src
/
libcollectdclient
/
client.c
diff --git
a/src/libcollectdclient/client.c
b/src/libcollectdclient/client.c
index
2523eea
..
0c748ba
100644
(file)
--- a/
src/libcollectdclient/client.c
+++ b/
src/libcollectdclient/client.c
@@
-23,11
+23,6
@@
# include "config.h"
#endif
# include "config.h"
#endif
-/* Set to C99 and POSIX code */
-#if COLLECT_STANDARDS
-# include "standards.h"
-#endif /* COLLECT_STANDARDS */
-
#if !defined(__GNUC__) || !__GNUC__
# define __attribute__(x) /**/
#endif
#if !defined(__GNUC__) || !__GNUC__
# define __attribute__(x) /**/
#endif
@@
-121,12
+116,12
@@
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 */
/* 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;
#if !HAVE_STRERROR_R
{
buf[0] = 0;
#if !HAVE_STRERROR_R
- snprintf (buf, buflen "Error #%i; strerror_r is not available.", errnum);
+ snprintf (buf, buflen
,
"Error #%i; strerror_r is not available.", errnum);
/* #endif !HAVE_STRERROR_R */
#elif STRERROR_R_CHAR_P
/* #endif !HAVE_STRERROR_R */
#elif STRERROR_R_CHAR_P
@@
-782,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, " interval=%i", vl->interval);
if (vl->time > 0)
- SSTRCATF (command, "%u", (unsigned int) vl->time);
+ SSTRCATF (command, "
%u", (unsigned int) vl->time);
else
else
- SSTRCAT (command, "N");
+ SSTRCAT (command, "
N");
for (i = 0; i < vl->values_len; i++)
{
for (i = 0; i < vl->values_len; i++)
{
@@
-797,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
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);
} /* for (i = 0; i < vl->values_len; i++) */
status = lcc_sendreceive (c, command, &res);