From 76ebdf2cc7b354847b76cc0a4b662d3f6ecafaa4 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Thu, 18 Jun 2015 09:16:18 +0200 Subject: [PATCH] powerdns plugin: Fix "Dead assignment" warning. --- src/powerdns.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/powerdns.c b/src/powerdns.c index 81e253bf..11974aaa 100644 --- 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) { -- 2.30.2