X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fapcups.c;h=2fa247995dde93f64321233d247e591b119d78d7;hb=61a4ed99b1a5b6d371bb745933d0efc5dff9505c;hp=31573d1e7d9018cd119a582cf0dd518578eb746b;hpb=0b7cd83a5e6bac068ea83a88a5ddcfb07c09fbec;p=collectd.git diff --git a/src/apcups.c b/src/apcups.c index 31573d1e..2fa24799 100644 --- a/src/apcups.c +++ b/src/apcups.c @@ -73,8 +73,8 @@ typedef struct { static char *conf_node = NULL; static char *conf_service = NULL; /* Defaults to false for backwards compatibility. */ -static _Bool conf_report_seconds = 0; -static _Bool conf_persistent_conn = 1; +static bool conf_report_seconds = 0; +static bool conf_persistent_conn = 1; static int global_sockfd = -1; @@ -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; } @@ -347,7 +347,7 @@ static int apc_query_server(char const *node, char const *service, } static int apcups_config(oconfig_item_t *ci) { - _Bool persistent_conn_set = 0; + bool persistent_conn_set = 0; for (int i = 0; i < ci->children_num; i++) { oconfig_item_t *child = ci->children + i;