projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c33db57
)
powerdns plugin: Fix "Dead assignment" warning.
author
Florian Forster
<octo@collectd.org>
Thu, 18 Jun 2015 07:16:18 +0000
(09:16 +0200)
committer
Florian Forster
<octo@collectd.org>
Thu, 18 Jun 2015 08:26:13 +0000
(10:26 +0200)
src/powerdns.c
patch
|
blob
|
history
diff --git
a/src/powerdns.c
b/src/powerdns.c
index
81e253b
..
11974aa
100644
(file)
--- a/
src/powerdns.c
+++ b/
src/powerdns.c
@@
-447,6
+447,12
@@
static int powerdns_get_data_stream (list_item_t *item, /* {{{ */
timeout.tv_sec=5;
timeout.tv_usec=0;
status = setsockopt (sd, SOL_SOCKET, SO_RCVTIMEO, &timeout, sizeof (timeout));
+ if (status != 0)
+ {
+ FUNC_ERROR ("setsockopt");
+ close (sd);
+ return (-1);
+ }
status = connect (sd, (struct sockaddr *) &item->sockaddr,
sizeof (item->sockaddr));
@@
-494,7
+500,6
@@
static int powerdns_get_data_stream (list_item_t *item, /* {{{ */
buffer[buffer_size] = 0;
} /* while (42) */
close (sd);
- sd = -1;
if (status < 0)
{