author | Marc Fournier <marc.fournier@camptocamp.com> | |
Mon, 24 Nov 2014 08:23:18 +0000 (09:23 +0100) | ||
committer | Marc Fournier <marc.fournier@camptocamp.com> | |
Mon, 24 Nov 2014 08:23:18 +0000 (09:23 +0100) |
Conflicts:
src/write_graphite.c
src/write_graphite.c
1 | 2 | |||
---|---|---|---|---|
src/Makefile.am | patch | | diff1 | | diff2 | | blob | history |
src/collectd.conf.pod | patch | | diff1 | | diff2 | | blob | history |
src/plugin.c | patch | | diff1 | | diff2 | | blob | history |
src/write_graphite.c | patch | | diff1 | | diff2 | | blob | history |
diff --cc src/Makefile.am
Simple merge
diff --cc src/collectd.conf.pod
Simple merge
diff --cc src/plugin.c
Simple merge
diff --cc src/write_graphite.c
index c17b7f36a6dc787e1eeac749388f5a8f6c5e8123,392d57001310038bb65abaee93a6a3a1b27e706d..504ea9d45fa2e55534e1fdc62fec4a0aab01db73
+++ b/src/write_graphite.c
const char *node = cb->node ? cb->node : WG_DEFAULT_NODE;
const char *service = cb->service ? cb->service : WG_DEFAULT_SERVICE;
+ const char *protocol = cb->protocol ? cb->protocol : WG_DEFAULT_PROTOCOL;
+ char connerr[1024] = "";
+
if (cb->sock_fd > 0)
return (0);
if (cb->sock_fd < 0)
{
- char errbuf[1024];
+ if (connerr[0] == '\0')
+ /* this should not happen but try to get a message anyway */
+ sstrerror (errno, connerr, sizeof (connerr));
c_complain (LOG_ERR, &cb->init_complaint,
- "write_graphite plugin: Connecting to %s:%s via %s failed. "
- "The last error was: %s", node, service, protocol,
- sstrerror (errno, errbuf, sizeof (errbuf)));
- "write_graphite plugin: Connecting to %s:%s failed. "
- "The last error was: %s", node, service, connerr);
++ "write_graphite plugin: Connecting to %s:%s via %s failed. "
++ "The last error was: %s", node, service, protocol, connerr);
return (-1);
}
else