X-Git-Url: https://git.octo.it/?p=collectd.git;a=blobdiff_plain;f=src%2Fapcups.c;h=31573d1e7d9018cd119a582cf0dd518578eb746b;hp=406c164a2b7e96781093c85b30524e3937d481e2;hb=0b7cd83a5e6bac068ea83a88a5ddcfb07c09fbec;hpb=a6a884d250900f2d7abcd1523aa4d97db520b9c2 diff --git a/src/apcups.c b/src/apcups.c index 406c164a..31573d1e 100644 --- a/src/apcups.c +++ b/src/apcups.c @@ -119,10 +119,8 @@ static int net_open(char const *node, char const *service) { status = getaddrinfo(node, service, &ai_hints, &ai_return); if (status != 0) { - char errbuf[1024]; INFO("apcups plugin: getaddrinfo failed: %s", - (status == EAI_SYSTEM) ? sstrerror(errno, errbuf, sizeof(errbuf)) - : gai_strerror(status)); + (status == EAI_SYSTEM) ? STRERRNO : gai_strerror(status)); return -1; } @@ -147,9 +145,7 @@ static int net_open(char const *node, char const *service) { if (status != 0) /* `connect(2)' failed */ { - char errbuf[1024]; - INFO("apcups plugin: connect failed: %s", - sstrerror(errno, errbuf, sizeof(errbuf))); + INFO("apcups plugin: connect failed: %s", STRERRNO); close(sd); return -1; } @@ -424,8 +420,8 @@ static int apcups_read(void) { int status = apc_query_server(conf_node, conf_service, &apcups_detail); if (status != 0) { - DEBUG("apcups plugin: apc_query_server (\"%s\", \"%s\") = %d", - conf_node, conf_service, status); + DEBUG("apcups plugin: apc_query_server (\"%s\", \"%s\") = %d", conf_node, + conf_service, status); return status; }