summaryrefslogtreecommitdiffstats
path: root/sysfs.cpp
diff options
context:
space:
mode:
authorMatt Spinler <spinler@us.ibm.com>2017-11-29 15:18:05 -0600
committerMatt Spinler <spinler@us.ibm.com>2017-11-29 15:26:51 -0600
commitfee106b9bf94e9a393c7c44b53b7cc5d9f89b439 (patch)
treebc98557a70c36d365dd6868bf4df95942cfb54ae /sysfs.cpp
parent67ce4a46999012eba2a0015a51619f474967d21c (diff)
downloadphosphor-hwmon-fee106b9bf94e9a393c7c44b53b7cc5d9f89b439.tar.gz
phosphor-hwmon-fee106b9bf94e9a393c7c44b53b7cc5d9f89b439.zip
Support reading 64 bit integers
Some sysfs *_input values may be bigger than 32 bits, for example power values reported in microwatts. As such, read an int64_t value out of sysfs instead of just a uint32_t. The D-Bus property that will hold the value is also the same type, an int64_t. Resolves openbmc/openbmc#2686 Change-Id: I4376de120825b73580d18d339fe76be454eeb18d Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Diffstat (limited to 'sysfs.cpp')
-rw-r--r--sysfs.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/sysfs.cpp b/sysfs.cpp
index 8b7ee48..aeee859 100644
--- a/sysfs.cpp
+++ b/sysfs.cpp
@@ -254,14 +254,14 @@ HwmonIO::HwmonIO(const std::string& path) : p(path)
}
-uint32_t HwmonIO::read(
+int64_t HwmonIO::read(
const std::string& type,
const std::string& id,
const std::string& sensor,
size_t retries,
std::chrono::milliseconds delay) const
{
- uint32_t val;
+ int64_t val;
std::ifstream ifs;
auto fullPath = sysfs::make_sysfs_path(
p, type, id, sensor);
OpenPOWER on IntegriCloud