Fix overlay loop
The increment was being skipped. This was introduced
during code-review
Tested-by: loop went away
Change-Id: I9bb80fb44b8bc3ef66aca5df2bb0ef10a531a1af
Signed-off-by: James Feist <james.feist@linux.intel.com>
diff --git a/src/Overlay.cpp b/src/Overlay.cpp
index 4bc733f..8c246d4 100644
--- a/src/Overlay.cpp
+++ b/src/Overlay.cpp
@@ -147,28 +147,26 @@
}
}
// if configuration has name empty, don't put it in dev
- if (channelName.empty())
+ if (!channelName.empty())
{
- continue;
+ std::filesystem::path bus =
+ std::filesystem::read_symlink(channelPath);
+ const std::string& busName = bus.filename();
+
+ std::string linkDir = MUX_SYMLINK_DIR + std::string("/") + muxName;
+ if (channel == 0)
+ {
+ std::filesystem::create_directory(linkDir, ec);
+ }
+ std::filesystem::create_symlink(
+ "/dev/" + busName, linkDir + std::string("/") + channelName,
+ ec);
+
+ if (ec)
+ {
+ std::cerr << "Failure creating symlink for " << busName << "\n";
+ }
}
-
- std::filesystem::path bus = std::filesystem::read_symlink(channelPath);
- const std::string& busName = bus.filename();
-
- std::string linkDir = MUX_SYMLINK_DIR + std::string("/") + muxName;
- if (channel == 0)
- {
- std::filesystem::create_directory(linkDir, ec);
- }
- std::filesystem::create_symlink(
- "/dev/" + busName, linkDir + std::string("/") + channelName, ec);
-
- if (ec)
- {
- std::cerr << "Failure creating symlink for " << busName << "\n";
- return;
- }
-
channel++;
channelPath = devDir / ("channel-" + std::to_string(channel));
}