diff options
author | Matt Spinler <spinler@us.ibm.com> | 2017-11-16 13:03:16 -0600 |
---|---|---|
committer | Matt Spinler <spinler@us.ibm.com> | 2017-11-16 13:21:42 -0600 |
commit | 67ce4a46999012eba2a0015a51619f474967d21c (patch) | |
tree | 5c2d7a92f02ca6f699a7c1bbe7de400929309930 | |
parent | 4d9a35b232f0bfabe961768f346d958399ff0dec (diff) | |
download | phosphor-hwmon-67ce4a46999012eba2a0015a51619f474967d21c.tar.gz phosphor-hwmon-67ce4a46999012eba2a0015a51619f474967d21c.zip |
Retry on ENODATA errors
A particular device in a particular system is known to fail
with an ENODATA errno when another entity is using the same
path to access it. Add it to the retry list so that
phosphor-hwmon will retry and hopefully be able to get a
clean read. Even for devices where this contention isn't
the case, the code may as well retry as opposed to trying
once and giving up.
Resolves openbmc/openbmc#2645
Change-Id: Ib7aaaa14be33a33794a8c62d6991f77ab65a2ffa
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
-rw-r--r-- | sysfs.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -62,6 +62,14 @@ static constexpr auto retryableErrors = { * and kill this process. */ ENODEV, + + /* + * Some devices return this when they are busy doing + * something else. Even if being busy isn't the cause, + * a retry still gives this app a shot at getting data + * as opposed to failing out on the first try. + */ + ENODATA, }; static const auto emptyString = ""s; |