if ((ret = getnameinfo((struct sockaddr*)&local, local_len,
buf, sizeof(buf), NULL, 0,
NI_NUMERICHOST)) != 0) {
- fprintf(stderr, "getnameinfo(): %s\n", gai_strerror(ret));
+ fprintf(stderr, "i3status: getnameinfo(): %s\n", gai_strerror(ret));
(void)close(fd);
return NULL;
}
* Returns the IPv6 address with which you have connectivity at the moment.
* The char * is statically allocated and mustn't be freed
*/
-static char *get_ipv6_addr() {
+static char *get_ipv6_addr(void) {
struct addrinfo hints;
struct addrinfo *result, *resp;
static struct addrinfo *cached = NULL;
char *outwalk = buffer;
if (addr_string == NULL) {
+ START_COLOR("color_bad");
OUTPUT_FULL_TEXT(format_down);
+ END_COLOR;
return;
}
walk += strlen("ip");
}
}
-
+ START_COLOR("color_good");
OUTPUT_FULL_TEXT(buffer);
+ END_COLOR;
}