OSDN Git Service

update
authorCharlie Root <root@ohsnap.lan>
Thu, 23 Nov 2017 17:49:07 +0000 (19:49 +0200)
committerCharlie Root <root@ohsnap.lan>
Thu, 23 Nov 2017 17:49:07 +0000 (19:49 +0200)
src/net.c
src/options.c

index 33dbfd4..b5acb99 100644 (file)
--- a/src/net.c
+++ b/src/net.c
@@ -731,7 +731,7 @@ get_wifi(char *str1, char *str2, uint8_t num) {
     memset(&ifmr, 0, sizeof(ifmr));
     strlcpy(ifmr.ifm_name, ifa->ifa_name, IF_NAMESIZE);
 
-    if (0 != ioctl(SIOCGIFMEDIA, (caddr_t)&ifmr)) {
+    if (0 != ioctl(fd, SIOCGIFMEDIA, (caddr_t)&ifmr)) {
       continue;
     }
     if (0 == (ifmr.ifm_active & IFM_IEEE80211)) {
index 1c685da..b61406b 100644 (file)
@@ -389,6 +389,11 @@ parse_opt(int key, char *arg, struct argp_state *state) {
     NEW_SWAPP_LABEL('F', char swapp_perc[VLA], swapp_perc, 4, FMT_SSD2, SSD_STR);
 
     NEW_NET_LABEL('j', char nic_info[VLA], nic_info, 7, FMT_KERN);
+
+#if defined(__OpenBSD__)
+    NEW_NET_LABEL('h', char wifiname[VLA], wifiname, 11, FMT_KERN);
+#endif /* __OpenBSD__ */
+
 #endif /* __FreeBSD__ || __OpenBSD__ */
 
 
@@ -408,9 +413,6 @@ parse_opt(int key, char *arg, struct argp_state *state) {
     NEW_NET_LABEL('e', char link_speed[VLA], link_speed, 7, FMT_KERN);
 #endif /* __linux__ */
 
-#if defined(__OpenBSD__)
-    NEW_NET_LABEL('h', char wifiname[VLA], wifiname, 11, FMT_KERN);
-#endif /* __OpenBSD__ */
 
     case 'V':
 #if defined(HAVE_ALSA_ASOUNDLIB_H) || defined(HAVE_SYS_SOUNDCARD_H) || \