X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fpowerdns.c;h=11974aaafdcb2122ad31f8c5d42bc9a81cfed645;hb=9c3ed6462c15fd1cb664cd0ec2a5efb289aa1af6;hp=f3d408302e17ba194607e567ac6433e793df294f;hpb=b61a03b05c1f4040a6599334b65141aa3bd134f5;p=collectd.git diff --git a/src/powerdns.c b/src/powerdns.c index f3d40830..11974aaa 100644 --- a/src/powerdns.c +++ b/src/powerdns.c @@ -84,10 +84,10 @@ typedef struct statname_lookup_s statname_lookup_t; /* Description of statistics returned by the recursor: {{{ all-outqueries counts the number of outgoing UDP queries since starting -answers0-1 counts the number of queries answered within 1 milisecond +answers0-1 counts the number of queries answered within 1 millisecond answers100-1000 counts the number of queries answered within 1 second -answers10-100 counts the number of queries answered within 100 miliseconds -answers1-10 counts the number of queries answered within 10 miliseconds +answers10-100 counts the number of queries answered within 100 milliseconds +answers1-10 counts the number of queries answered within 10 milliseconds answers-slow counts the number of queries answered after 1 second cache-entries shows the number of entries in the cache cache-hits counts the number of cache hits since starting @@ -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) {