From: Michael Stapelberg Date: Wed, 10 Dec 2008 10:11:31 +0000 (+0100) Subject: Don't show eth-speed if it was never set X-Git-Tag: 1.0~34 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=513cfe8f1bb892eda973221477ce385f2ca4aca8;p=i3%2Fi3status Don't show eth-speed if it was never set --- diff --git a/wmiistatus.c b/wmiistatus.c index 6604533..10b1b33 100644 --- a/wmiistatus.c +++ b/wmiistatus.c @@ -367,7 +367,7 @@ static char *get_eth_info() { ifr.ifr_data = (caddr_t)&ecmd; (void)strcpy(ifr.ifr_name, eth_interface); if ((err = ioctl(fd, SIOCETHTOOL, &ifr)) == 0) - ethspeed = ecmd.speed; + ethspeed = (ecmd.speed == 65535 ? 0 : ecmd.speed); else write_error_to_statusbar("Could not get interface speed. Insufficient privileges?"); (void)close(fd);