Introduction
Introduction Statistics Contact Development Disclaimer Help
tNuke some newlines - spoon - dwm status utility (2f30 fork)
git clone git://src.adamsgaard.dk/spoon
Log
Files
Refs
LICENSE
---
commit f25c8bd0592be9c238e3b7b70176d20367b9f60a
parent 539ec046cefa273e60a99d53415df6678ee24455
Author: sin <[email protected]>
Date: Tue, 24 May 2016 19:11:14 +0100
Nuke some newlines
Diffstat:
M spoon.c | 10 ----------
1 file changed, 0 insertions(+), 10 deletions(-)
---
diff --git a/spoon.c b/spoon.c
t@@ -177,31 +177,26 @@ wifiread(char *buf, size_t len)
warn("getifaddrs");
return -1;
}
-
for (ifa = ifas; ifa; ifa = ifa->ifa_next) {
s = socket(AF_INET, SOCK_DGRAM, 0);
if (s < 0) {
warn("socket");
continue;
}
-
memset(&ifmr, 0, sizeof(ifmr));
strlcpy(ifmr.ifm_name, ifa->ifa_name, IF_NAMESIZE);
if (ioctl(s, SIOCGIFMEDIA, (caddr_t)&ifmr) < 0) {
close(s);
continue;
}
-
if ((ifmr.ifm_active & IFM_IEEE80211) == 0) {
close(s);
continue;
}
-
if ((ifmr.ifm_active & IFM_IEEE80211_HOSTAP) != 0) {
close(s);
continue;
}
-
memset(&bssid, 0, sizeof(bssid));
strlcpy(bssid.i_name, ifa->ifa_name, sizeof(bssid.i_name));
ibssid = ioctl(s, SIOCG80211BSSID, &bssid);
t@@ -209,7 +204,6 @@ wifiread(char *buf, size_t len)
close(s);
continue;
}
-
memset(&nr, 0, sizeof(nr));
memcpy(&nr.nr_macaddr, bssid.i_bssid, sizeof(nr.nr_macaddr));
strlcpy(nr.nr_ifname, ifa->ifa_name, sizeof(nr.nr_ifname));
t@@ -218,10 +212,8 @@ wifiread(char *buf, size_t len)
continue;
}
close(s);
-
if (nr.nr_rssi == 0)
continue;
-
if (nr.nr_max_rssi == 0) {
if (nr.nr_rssi <= -100)
quality = 0;
t@@ -232,7 +224,6 @@ wifiread(char *buf, size_t len)
} else {
quality = IEEE80211_NODEREQ_RSSI(&nr);
}
-
if (quality == 100)
icon = "::";
else if (quality >= 75)
t@@ -363,7 +354,6 @@ loop(void)
dpy = XOpenDisplay(NULL);
if (dpy == NULL)
errx(1, "cannot open display");
-
for (;;) {
entcat(line, sizeof(line));
XStoreName(dpy, DefaultRootWindow(dpy), line);
You are viewing proxied material from mx1.adamsgaard.dk. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.