+ memset(&hints, 0, sizeof(struct addrinfo));
+ hints.ai_family = AF_UNSPEC;
+ hints.ai_socktype = SOCK_STREAM;
+ hints.ai_flags = 0;
+ hints.ai_protocol = 0;
+ snprintf(portbuf, 8, "%d", info.apcupsd.port);
+ res = getaddrinfo(info.apcupsd.host, portbuf, &hints, &ai);
+ if (res != 0) {
+ NORM_ERR("APCUPSD getaddrinfo: %s", gai_strerror(res));