]> git.sur5r.net Git - i3/i3status/commitdiff
Make print_disk_info, print_eth_info and print_wireless_info compile on NetBSD withou...
authorTommie Gannert <tommie@gannert.se>
Mon, 1 Aug 2016 13:34:39 +0000 (14:34 +0100)
committerTommie Gannert <tommie@gannert.se>
Sun, 14 Aug 2016 10:52:27 +0000 (11:52 +0100)
src/print_disk_info.c
src/print_eth_info.c
src/print_wireless_info.c

index 629e05b30d041eed235800133810bed05560a0c5..edc69ace299639863c26515aee67d30f911abd29 100644 (file)
@@ -10,6 +10,7 @@
 #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || (__OpenBSD__) || defined(__DragonFly__) || defined(__APPLE__)
 #include <sys/param.h>
 #include <sys/mount.h>
+#elif defined(__NetBSD__)
 #else
 #include <mntent.h>
 #endif
@@ -121,6 +122,11 @@ void print_disk_info(yajl_gen json_gen, char *buffer, const char *path, const ch
 
     if (statfs(path, &buf) == -1)
         return;
+#elif defined(__NetBSD__)
+    struct statvfs buf;
+
+    if (statvfs(path, &buf) == -1)
+        return;
 #else
     struct statvfs buf;
 
index 34ffa363e4f483e59ab1b53723f06e0ca8898b8d..e4bf15ea89d4984194310b33652210dcc4929252 100644 (file)
@@ -79,7 +79,7 @@ static int print_eth_speed(char *outwalk, const char *interface) {
     ethspeed = (desc->ifmt_string != NULL ? desc->ifmt_string : "?");
     return sprintf(outwalk, "%s", ethspeed);
 #elif defined(__OpenBSD__) || defined(__NetBSD__)
-    char *ethspeed;
+    const char *ethspeed;
     struct ifmediareq ifmr;
 
     (void)memset(&ifmr, 0, sizeof(ifmr));
index 70dbdb450861417daf4e3ff873c532b95787f3a9..14879ebf7cbccb5b077e040c52afb5b309f765e4 100644 (file)
 #define IW_ESSID_MAX_SIZE IEEE80211_NWID_LEN
 #endif
 
+#ifdef __NetBSD__
+#include <sys/types.h>
+#include <net80211/ieee80211.h>
+#define IW_ESSID_MAX_SIZE IEEE80211_NWID_LEN
+#endif
+
 #include "i3status.h"
 
 #define WIRELESS_INFO_FLAG_HAS_ESSID (1 << 0)