]> git.sur5r.net Git - i3/i3status/commitdiff
Don't show eth-speed if it was never set
authorMichael Stapelberg <michael+x200@stapelberg.de>
Wed, 10 Dec 2008 10:11:31 +0000 (11:11 +0100)
committerMichael Stapelberg <michael+x200@stapelberg.de>
Wed, 10 Dec 2008 10:11:31 +0000 (11:11 +0100)
wmiistatus.c

index 6604533f83bffc18851cf89142841d94185cddfc..10b1b331e399a3b61cb3c43173b42951d551dc89 100644 (file)
@@ -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);