From: Michael Stapelberg Date: Mon, 19 Apr 2010 11:29:52 +0000 (+0200) Subject: Treat the interface as 'down' when it cannot be found in /proc/net/wireless (Thanks... X-Git-Tag: 2.2~31 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=01210258d09cda5df3c289e08ec9fbe314be2b90;p=i3%2Fi3status Treat the interface as 'down' when it cannot be found in /proc/net/wireless (Thanks to Fabio Zanini) --- 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"));