diff options
author | Patrick Venture <venture@google.com> | 2017-11-07 12:09:49 -0800 |
---|---|---|
committer | Patrick Venture <venture@google.com> | 2018-03-30 14:44:06 +0000 |
commit | c1cece76a0d0054b705a7f05c8500fecdfb8c5e8 (patch) | |
tree | fede075880e005c2b9c13e9d2397162107699f75 /sysfs.cpp | |
parent | a23babd6952cb21397d6aa408a827047d1de81de (diff) | |
download | phosphor-hwmon-c1cece76a0d0054b705a7f05c8500fecdfb8c5e8.tar.gz phosphor-hwmon-c1cece76a0d0054b705a7f05c8500fecdfb8c5e8.zip |
Add configure option for how read fails behave
Different platforms have different requirements for handling
hwmon sysfs access failures.
The default behavior is that a read failure leads to the daemon
exiting after some number of read failures. This can be controlled
to then remove the object from the dbus on failure. Now, it can
instead be controlled to return -errno on read failure.
This new behavior to set the value to -errno must be checked by
whatever mechanism is reporting the value.
Change-Id: I50b93aea56f22267da79c9571319f281e24a1e6f
Signed-off-by: Patrick Venture <venture@google.com>
Diffstat (limited to 'sysfs.cpp')
-rw-r--r-- | sysfs.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -21,6 +21,7 @@ #include <memory> #include <phosphor-logging/log.hpp> #include <thread> +#include "config.h" #include "sysfs.hpp" using namespace std::string_literals; @@ -361,6 +362,9 @@ int64_t HwmonIO::read( !retries) { // Not a retryable error or out of retries. +#ifdef NEGATIVE_ERRNO_ON_FAIL + return -rc; +#endif // Work around GCC bugs 53984 and 66145 for callers by // explicitly raising system_error here. |