summaryrefslogtreecommitdiffstats
path: root/mainloop.cpp
diff options
context:
space:
mode:
authorBrad Bishop <bradleyb@fuzziesquirrel.com>2017-08-25 09:56:02 -0400
committerBrad Bishop <bradleyb@fuzziesquirrel.com>2017-08-31 08:42:36 -0400
commitf3aa9aef15e6af45dea260b066b729db6c4a5584 (patch)
treed0d24b7e2a089b46e55766c1520d7bf17b234dd1 /mainloop.cpp
parent431d26a58b89b88492a0dc5c87d3d9e8de49ade1 (diff)
downloadphosphor-hwmon-f3aa9aef15e6af45dea260b066b729db6c4a5584.tar.gz
phosphor-hwmon-f3aa9aef15e6af45dea260b066b729db6c4a5584.zip
mainloop: Cache devpath at startup
Currently the devpath is determined after a bus error to make a callout. Finding the path at startup is less prone to race conditions around ENOENT on driver unload in the event of a callout. Change-Id: I8ce8d9f630c8b7ecc398082002aa113ab352d3cb Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'mainloop.cpp')
-rw-r--r--mainloop.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/mainloop.cpp b/mainloop.cpp
index 486a175..11f03a5 100644
--- a/mainloop.cpp
+++ b/mainloop.cpp
@@ -208,6 +208,7 @@ auto addValue(const SensorSet::key_type& sensor,
MainLoop::MainLoop(
sdbusplus::bus::bus&& bus,
const std::string& path,
+ const std::string& devPath,
const char* prefix,
const char* root)
: _bus(std::move(bus)),
@@ -215,6 +216,7 @@ MainLoop::MainLoop(
_shutdown(false),
_hwmonRoot(),
_instance(),
+ _devPath(devPath),
_prefix(prefix),
_root(root),
state()
OpenPOWER on IntegriCloud