little fixes for FreeBSD

This commit is contained in:
Michael Stapelberg 2009-07-22 18:51:55 +02:00
parent 329a8994f7
commit 072cee2808
2 changed files with 3 additions and 2 deletions

View 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

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