From f3aa9aef15e6af45dea260b066b729db6c4a5584 Mon Sep 17 00:00:00 2001 From: Brad Bishop Date: Fri, 25 Aug 2017 09:56:02 -0400 Subject: 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 --- mainloop.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'mainloop.cpp') 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() -- cgit v1.2.3