net: Don't disable when linkspeed not detected (#1772)
Shows "N/A" instead. Fixes #1211
This commit is contained in:
parent
99e823bd0a
commit
3e83fb9fb2
@ -270,11 +270,11 @@ namespace net {
|
||||
request.ifr_data = reinterpret_cast<char*>(&data);
|
||||
|
||||
if (ioctl(*m_socketfd, SIOCETHTOOL, &request) == -1) {
|
||||
return false;
|
||||
m_linkspeed = -1;
|
||||
} else {
|
||||
m_linkspeed = data.speed;
|
||||
}
|
||||
|
||||
m_linkspeed = data.speed;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -306,7 +306,7 @@ namespace net {
|
||||
* about the current connection
|
||||
*/
|
||||
string wired_network::linkspeed() const {
|
||||
return (m_linkspeed == 0 ? "???" : to_string(m_linkspeed)) + " Mbit/s";
|
||||
return m_linkspeed == -1 ? "N/A" : (to_string(m_linkspeed) + " Mbit/s");
|
||||
}
|
||||
|
||||
// }}}
|
||||
|
Loading…
Reference in New Issue
Block a user