Fix D-Bus introspect timeout error in cpusensor
This commit moves the requesting bus name code to just before
calling of io->run to avoid phosphor->mapper introspect failure.
Tested: CPU sensors exposed well.
Change-Id: I41a8ebddee7e7a1e18dc223e4ff0c170a5c29264
Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com>
diff --git a/src/CPUSensorMain.cpp b/src/CPUSensorMain.cpp
index 0e6f99d..60820de 100644
--- a/src/CPUSensorMain.cpp
+++ b/src/CPUSensorMain.cpp
@@ -673,7 +673,6 @@
auto systemBus = std::make_shared<sdbusplus::asio::connection>(io);
boost::container::flat_set<CPUConfig> cpuConfigs;
- systemBus->request_name("xyz.openbmc_project.CPUSensor");
sdbusplus::asio::object_server objectServer(systemBus);
std::vector<std::unique_ptr<sdbusplus::bus::match::match>> matches;
boost::asio::deadline_timer pingTimer(io);
@@ -736,5 +735,6 @@
matches.emplace_back(std::move(match));
}
+ systemBus->request_name("xyz.openbmc_project.CPUSensor");
io.run();
}