[fru-device] harden i2c regex
Now that we have i2c-mux we need to not match that
when searching.
Tested-by: Fru-device operates well
Change-Id: Ic1a617735ec84d9d81984fba47af8d3d34d16f25
Signed-off-by: James Feist <james.feist@linux.intel.com>
diff --git a/src/FruDevice.cpp b/src/FruDevice.cpp
index 5469edf..eb56c6a 100644
--- a/src/FruDevice.cpp
+++ b/src/FruDevice.cpp
@@ -681,7 +681,7 @@
// setup an async wait in case we get flooded with requests
timer.async_wait([&](const boost::system::error_code& ec) {
auto devDir = fs::path("/dev/");
- auto matchString = std::string("i2c*");
+ auto matchString = std::string(R"(i2c-\d+$)");
std::vector<fs::path> i2cBuses;
if (!findFiles(devDir, matchString, i2cBuses))
@@ -730,7 +730,7 @@
int main(int argc, char** argv)
{
auto devDir = fs::path("/dev/");
- auto matchString = std::string("i2c*");
+ auto matchString = std::string(R"(i2c-\d+$)");
std::vector<fs::path> i2cBuses;
if (!findFiles(devDir, matchString, i2cBuses))