X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fzookeeper.c;h=89ec6d267dd9c98f7a6a1b3d0401578e4343bd65;hb=b813643789200665894f63efba67d940df37e245;hp=63ee6c90040596ec54198ee2a11909611dc04ad0;hpb=9817e7298bd6c364fa17347327af54adf048bd21;p=collectd.git diff --git a/src/zookeeper.c b/src/zookeeper.c index 63ee6c90..89ec6d26 100644 --- a/src/zookeeper.c +++ b/src/zookeeper.c @@ -29,7 +29,6 @@ #include "plugin.h" #include -#include #include #include #include @@ -109,8 +108,8 @@ static int zookeeper_connect (void) struct addrinfo ai_hints; struct addrinfo *ai; struct addrinfo *ai_list; - char *host; - char *port; + const char *host; + const char *port; memset ((void *) &ai_hints, '\0', sizeof (ai_hints)); ai_hints.ai_family = AF_UNSPEC; @@ -160,8 +159,7 @@ static int zookeeper_connect (void) static int zookeeper_query (char *buffer, size_t buffer_size) { - int sk = -1; - int status; + int sk, status; size_t buffer_fill; sk = zookeeper_connect(); @@ -199,11 +197,6 @@ static int zookeeper_query (char *buffer, size_t buffer_size) } buffer_fill += (size_t) status; - if (status == 0) - { - /* done reading from the socket */ - break; - } } /* while (recv) */ status = 0;