Blame SOURCES/0012-code-clean-up-only-set-businfo-or-modalias-when-it-s.patch

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