summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stapelberg <michael@stapelberg.de>2010-04-19 13:29:52 +0200
committerMichael Stapelberg <michael@stapelberg.de>2010-04-19 13:29:52 +0200
commit01210258d09cda5df3c289e08ec9fbe314be2b90 (patch)
treeb51d9052da0d215ff1de22e02bb983c551df056e
parentce5122e3f7288230d0174e0ab1e43023f7ea4fa7 (diff)
Treat the interface as 'down' when it cannot be found in /proc/net/wireless (Thanks to Fabio Zanini)
-rw-r--r--src/print_wireless_info.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/print_wireless_info.c b/src/print_wireless_info.c
index 946c589..968ff66 100644
--- a/src/print_wireless_info.c
+++ b/src/print_wireless_info.c
@@ -38,7 +38,7 @@ static const char *get_wireless_essid(const char *interface) {
*/
void print_wireless_info(const char *interface, const char *format_up, const char *format_down) {
char buf[1024];
- int quality = -1;
+ int quality = 0;
char *interfaces;
const char *walk;
memset(buf, 0, sizeof(buf));
@@ -57,10 +57,6 @@ void print_wireless_info(const char *interface, const char *format_up, const cha
break;
}
- /* Interface could not be found */
- if (quality == -1)
- return;
-
if ((quality == UCHAR_MAX) || (quality == 0)) {
walk = format_down;
printf("%s", color("#FF0000"));