mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-12-25 12:10:03 +00:00
Cleanup wifi code a bit.
git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky1@758 7f574dfc-610e-0410-a909-a81674777703
This commit is contained in:
parent
60393cc107
commit
38d2d64b08
@ -555,20 +555,14 @@ update_wifi_stats()
|
||||
for (ifa = ifap; ifa; ifa = ifa->ifa_next) {
|
||||
ns = get_net_stat((const char *) ifa->ifa_name);
|
||||
|
||||
if (!strcmp(ifa->ifa_name, "lo0") ||
|
||||
!strncmp(ifa->ifa_name, "fwe", 3) ||
|
||||
!strncmp(ifa->ifa_name, "tun", 3))
|
||||
continue;
|
||||
|
||||
s = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
|
||||
|
||||
/* Get media type */
|
||||
bzero(&ifmr, sizeof(ifmr));
|
||||
strlcpy(ifmr.ifm_name, ifa->ifa_name, IFNAMSIZ);
|
||||
if (ioctl(s, SIOCGIFMEDIA, (caddr_t) &ifmr) < 0) {
|
||||
perror("ioctl (getting media type)");
|
||||
exit(1);
|
||||
}
|
||||
if (ioctl(s, SIOCGIFMEDIA, (caddr_t) &ifmr) < 0)
|
||||
goto cleanup;
|
||||
|
||||
/*
|
||||
* We can monitor only wireless interfaces
|
||||
* which not in hostap mode
|
||||
@ -594,7 +588,7 @@ update_wifi_stats()
|
||||
*/
|
||||
ns->linkstatus = (int) wireq.wi_val[1];
|
||||
}
|
||||
|
||||
cleanup:
|
||||
close(s);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user