summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8327ee6)
raw | patch | inline | side by side (parent: 8327ee6)
author | Michael Hart <michael.hart@arcticwolf.com> | |
Fri, 20 Dec 2013 14:56:54 +0000 (09:56 -0500) | ||
committer | Marc Fournier <marc.fournier@camptocamp.com> | |
Mon, 6 Jan 2014 17:14:45 +0000 (18:14 +0100) |
Conflicts:
src/write_graphite.c
src/write_graphite.c
src/write_graphite.c | patch | blob | history |
diff --git a/src/write_graphite.c b/src/write_graphite.c
index c3d6bf103490a7f2f4dfeefe33f6d42db0f9f39b..c17b7f36a6dc787e1eeac749388f5a8f6c5e8123 100644 (file)
--- a/src/write_graphite.c
+++ b/src/write_graphite.c
ssize_t status = 0;
status = swrite (cb->sock_fd, cb->send_buf, strlen (cb->send_buf));
- if (cb->log_send_errors && status < 0)
+ if (status < 0)
{
- char errbuf[1024];
const char *protocol = cb->protocol ? cb->protocol : WG_DEFAULT_PROTOCOL;
- ERROR ("write_graphite plugin: send to %s:%s (%s) failed with status %zi (%s)",
- cb->node, cb->service, protocol,
- status, sstrerror (errno, errbuf, sizeof (errbuf)));
-
+ if (cb->log_send_errors)
+ {
+ char errbuf[1024];
+ ERROR ("write_graphite plugin: send to %s:%s (%s) failed with status %zi (%s)",
+ cb->node, cb->service, protocol,
+ status, sstrerror (errno, errbuf, sizeof (errbuf)));
+ }
close (cb->sock_fd);
cb->sock_fd = -1;