summaryrefslogtreecommitdiffstats
path: root/readd.cpp
diff options
context:
space:
mode:
authorPatrick Venture <venture@google.com>2017-06-01 14:07:05 -0700
committerPatrick Williams <patrick@stwcx.xyz>2017-07-27 15:43:26 +0000
commit1e6324fa4fc233c3f2913b3d5278aa06e45ff42f (patch)
treecfd44aa2872a55986db5a90392837f304c4d2190 /readd.cpp
parent2f370c4e351adb90dc218d719b962cb841a399eb (diff)
downloadphosphor-hwmon-1e6324fa4fc233c3f2913b3d5278aa06e45ff42f.tar.gz
phosphor-hwmon-1e6324fa4fc233c3f2913b3d5278aa06e45ff42f.zip
Don't exit program on sysfs read failures.
We have an unreliable fan in one of the test systems and at present if the sysfs entry is unavailable or returns failure, then the program will exit. The program could be serving many sensors, and any one failure will cause it to exit. This is true not only when initially creating the sensors, but also if any sensor read fails at run-time. Testing: I verified the program logged the failures, which may not be ideal if there is a buggy sensor, but, I also ran it and managed to catch it where the sensor wasn't there initially and it cleanly reported only the sensors that were responsive and didn't just exit. There is certainly a case to be made for re-scanning periodically if the sensor returns or there was a timing issue, and there is a separate bug for that. This commit means only to make the program more robust on failure. Change-Id: I310a3e3c0e0ea86e439341a296b741ded18f46f2 Signed-off-by: Patrick Venture <venture@google.com>
Diffstat (limited to 'readd.cpp')
-rw-r--r--readd.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/readd.cpp b/readd.cpp
index 8253d92..95c6887 100644
--- a/readd.cpp
+++ b/readd.cpp
@@ -37,7 +37,7 @@ int main(int argc, char** argv)
auto path = (*options)["of-name"];
if (path != ArgumentParser::empty_string)
{
- path = findHwmon(path);
+ path = sysfs::findHwmon(path);
}
if (path == ArgumentParser::empty_string)
OpenPOWER on IntegriCloud