diff options
author | Matt Spinler <spinler@us.ibm.com> | 2017-10-12 16:48:07 -0500 |
---|---|---|
committer | Matt Spinler <spinler@us.ibm.com> | 2017-10-17 10:03:10 -0500 |
commit | 5ac7b19f912171a0d6828b2a9d523f4a3853dcc8 (patch) | |
tree | 0c0397845eb576fc367f96c3c81ae2b8c5ca0631 | |
parent | 4b68c4eebdfaecf2bb7530fdf3ca009ad0ddfc40 (diff) | |
download | phosphor-hwmon-5ac7b19f912171a0d6828b2a9d523f4a3853dcc8.tar.gz phosphor-hwmon-5ac7b19f912171a0d6828b2a9d523f4a3853dcc8.zip |
Remove getIndirectLabelEnv
It is no longer used.
Change-Id: I4713fbd9232dfeed045125cbb827b4fe98c53717
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
-rw-r--r-- | env.cpp | 41 | ||||
-rw-r--r-- | env.hpp | 16 |
2 files changed, 0 insertions, 57 deletions
@@ -76,45 +76,4 @@ std::string getIndirectID( return content; } -std::string getIndirectLabelEnv( - const char* prefix, std::string path, const SensorSet::key_type& sensor) -{ - std::string key; - std::string value; - - path.append(sensor.first); - path.append(sensor.second); - path.append(1, '_'); - path.append(hwmon::entry::label); - - std::ifstream handle(path.c_str()); - if (handle.fail()) - { - return value; - } - - std::string content( - (std::istreambuf_iterator<char>(handle)), - (std::istreambuf_iterator<char>())); - - if (content.empty()) - { - return value; - } - - content.pop_back(); - - key.assign(prefix); - key.append(1, '_'); - key.append(sensor.first); - key.append(content); - auto env = getenv(key.c_str()); - if (env) - { - value.assign(env); - } - - return value; -} - // vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4 @@ -38,19 +38,3 @@ std::string getEnv( std::string getIndirectID( std::string path, const SensorSet::key_type& sensor); - -/** @brief Get the label for the sensor with a level of indirection. - * - * Read the sensor number from the <path>/<item><X>_label file.<item> & <X> is - * populated from the sensor key. The sensor label is read from the environment - * variable <prefix>_<item><sensorNum>. - * - * @param[in] prefix - Prefix of the environment variable. - * @param[in] path - Directory path of the label file. - * @param[in] sensor - Sensor details. - * - * @return On success return the sensor label, in case of failure return empty - * string. - */ -std::string getIndirectLabelEnv( - const char* prefix, std::string path, const SensorSet::key_type& sensor); |