// vim:ts=8:expandtab
-#include <netinet/in.h>
-#include <sys/socket.h>
#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
if (ifaddr == NULL)
return NULL;
- addrp = ifaddr;
-
/* Skip until we are at the AF_INET address of interface */
for (addrp = ifaddr;
int ret;
if ((ret = getnameinfo(addrp->ifa_addr, len, part, sizeof(part), NULL, 0, NI_NUMERICHOST)) != 0) {
- fprintf(stderr, "getnameinfo(): %s\n", gai_strerror(ret));
+ fprintf(stderr, "i3status: getnameinfo(): %s\n", gai_strerror(ret));
freeifaddrs(ifaddr);
return "no IP";
}