]> git.sur5r.net Git - i3/i3status/commitdiff
little fixes for FreeBSD
authorMichael Stapelberg <michael@stapelberg.de>
Wed, 22 Jul 2009 16:51:55 +0000 (18:51 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Wed, 22 Jul 2009 16:51:55 +0000 (18:51 +0200)
src/get_eth_info.c
src/get_ip_addr.c

index 9172abb34e50eca0be59eca769a42125b617c0b0..6278b8c10d8abdc144ee98fbcdb92323aa110606 100644 (file)
@@ -74,7 +74,7 @@ const char *get_eth_info() {
 #elif defined(__FreeBSD__)
                 struct ifmediareq ifm;
                 (void)memset(&ifm, 0, sizeof(ifm));
-                (void)strncpy(ifm.ifm_name, ifaddr->ifa_name, sizeof(ifm.ifm_name));
+                (void)strncpy(ifm.ifm_name, eth_interface, sizeof(ifm.ifm_name));
                 int ret = ioctl(general_socket, SIOCGIFMEDIA, (caddr_t)&ifm);
 
                 /* Get the description of the media type, partially taken from
index cc812f2e8b1869e85246775b9d30b28df2485ca6..c3942273185a361406805882f640aa42bbd757af 100644 (file)
@@ -1,5 +1,5 @@
 // vim:ts=8:expandtab
-#include <net/if.h>
+#include <netinet/in.h>
 #include <sys/socket.h>
 #include <sys/types.h>
 #include <stdlib.h>
@@ -7,6 +7,7 @@
 #include <string.h>
 #include <netdb.h>
 #include <ifaddrs.h>
+#include <net/if.h>
 
 #include "i3status.h"