Make print_disk_info, print_eth_info and print_wireless_info compile on NetBSD without warnings.

This commit is contained in:
Tommie Gannert 2016-08-01 14:34:39 +01:00
parent 185d70ecbb
commit 7728cff370
3 changed files with 13 additions and 1 deletions

View 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;

View 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));

View File

@ -57,6 +57,12 @@
#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)