summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d7c0080)
raw | patch | inline | side by side (parent: d7c0080)
author | Michael Hart <michael.hart@arcticwolf.com> | |
Fri, 20 Dec 2013 14:56:54 +0000 (09:56 -0500) | ||
committer | Michael Hart <michael.hart@arcticwolf.com> | |
Fri, 20 Dec 2013 14:56:54 +0000 (09:56 -0500) |
src/write_graphite.c | patch | blob | history |
diff --git a/src/write_graphite.c b/src/write_graphite.c
index 6124d33edf5a07ae26f922b1cc7a151a959b6c28..e49970c3f630dbe3fe17aecfd758417e2cb031de 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];
- ERROR ("write_graphite plugin: send to %s:%s (%s) failed with status %zi (%s)",
- cb->node, cb->service, cb->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, cb->protocol,
+ status, sstrerror (errno, errbuf, sizeof (errbuf)));
+ }
close (cb->sock_fd);
cb->sock_fd = -1;