From b314f4ffa28980ffcadb7eecb0c2b0def6e11c49 Mon Sep 17 00:00:00 2001 From: Lyonel Vincent Date: Wed, 17 Aug 2016 00:05:17 +0200 Subject: [PATCH 12/43] code clean-up: only set businfo or modalias when it's known --- src/core/network.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/core/network.cc b/src/core/network.cc index 77233fc..1d54959 100644 --- a/src/core/network.cc +++ b/src/core/network.cc @@ -336,8 +336,11 @@ bool scan_network(hwNode & n) interface.addHint("icon", string("network")); string businfo = sysfs::entry::byClass("net", interface.getLogicalName()).businfo(); - interface.setBusInfo(businfo); - interface.setConfig("modalias", sysfs::entry::byClass("net", interface.getLogicalName()).modalias()); + if (businfo!="") + interface.setBusInfo(businfo); + string modalias = sysfs::entry::byClass("net", interface.getLogicalName()).modalias(); + if (modalias!="") + interface.setConfig("modalias", modalias); //scan_mii(fd, interface); scan_ip(interface); -- 2.10.2