X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fapcups.c;h=262fa42432db9a84663d3c5da99b7e08289eeeac;hb=849f5394cce97a76da080f6cd9e5194b7f4ee0f0;hp=31573d1e7d9018cd119a582cf0dd518578eb746b;hpb=0b7cd83a5e6bac068ea83a88a5ddcfb07c09fbec;p=collectd.git diff --git a/src/apcups.c b/src/apcups.c index 31573d1e..262fa424 100644 --- a/src/apcups.c +++ b/src/apcups.c @@ -236,7 +236,8 @@ static int apc_query_server(char const *node, char const *service, char recvline[1024]; char *tokptr; char *toksaveptr; - int try = 0; + int try + = 0; int status; #if APCMAIN @@ -261,7 +262,8 @@ static int apc_query_server(char const *node, char const *service, /* net_send closes the socket on error. */ assert(global_sockfd < 0); if (try == 0) { - try++; + try + ++; count_retries++; continue; } @@ -337,9 +339,7 @@ static int apc_query_server(char const *node, char const *service, net_shutdown(&global_sockfd); if (n < 0) { - char errbuf[1024]; - ERROR("apcups plugin: Reading from socket failed: %s", - sstrerror(status, errbuf, sizeof(errbuf))); + ERROR("apcups plugin: Reading from socket failed: %s", STRERROR(status)); return -1; }