projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #1856 from rubenk/snmp-dont-dispatch-values-with-empty-type-instance
[collectd.git]
/
src
/
apcups.c
diff --git
a/src/apcups.c
b/src/apcups.c
index
014f5e5
..
cc20357
100644
(file)
--- a/
src/apcups.c
+++ b/
src/apcups.c
@@
-116,13
+116,14
@@
static int net_open (char const *node, char const *service)
{
int sd;
int status;
{
int sd;
int status;
- struct addrinfo ai_hints = { 0 };
struct addrinfo *ai_return;
struct addrinfo *ai_list;
/* TODO: Change this to `AF_UNSPEC' if apcupsd can handle IPv6 */
struct addrinfo *ai_return;
struct addrinfo *ai_list;
/* TODO: Change this to `AF_UNSPEC' if apcupsd can handle IPv6 */
- ai_hints.ai_family = AF_INET;
- ai_hints.ai_socktype = SOCK_STREAM;
+ struct addrinfo ai_hints = {
+ .ai_family = AF_INET,
+ .ai_socktype = SOCK_STREAM
+ };
status = getaddrinfo (node, service, &ai_hints, &ai_return);
if (status != 0)
status = getaddrinfo (node, service, &ai_hints, &ai_return);
if (status != 0)
@@
-380,10
+381,9
@@
static int apc_query_server (char const *node, char const *service,
static int apcups_config (oconfig_item_t *ci)
{
static int apcups_config (oconfig_item_t *ci)
{
- int i;
_Bool persistent_conn_set = 0;
_Bool persistent_conn_set = 0;
- for (i = 0; i < ci->children_num; i++)
+ for (i
nt i
= 0; i < ci->children_num; i++)
{
oconfig_item_t *child = ci->children + i;
{
oconfig_item_t *child = ci->children + i;