summaryrefslogtreecommitdiffstats
path: root/occ_device.cpp
blob: 812950202024e1d7fc2606b6cce9534c6893b5bd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include <iostream>
#include "occ_device.hpp"

namespace open_power
{
namespace occ
{

fs::path Device::bindPath = fs::path(OCC_HWMON_PATH) / "bind";
fs::path Device::unBindPath = fs::path(OCC_HWMON_PATH) / "unbind";

bool Device::master() const
{
    int master;
    auto masterFile = fs::path(DEV_PATH) / config / "occ_master";
    std::ifstream file(masterFile, std::ios::in);

    if (!file)
    {
        return false;
    }

    file >> master;
    file.close();
    return (master != 0);
}

} // namespace occ
} // namespace open_power
OpenPOWER on IntegriCloud