diff options
author | Guillaume LE VAILLANT <guillaume.le.vaillant@openmailbox.org> | 2017-03-28 11:35:18 +0200 |
---|---|---|
committer | Guillaume LE VAILLANT <guillaume.le.vaillant@openmailbox.org> | 2017-03-28 11:35:18 +0200 |
commit | 64377c90b5eef8bd3d19ae5dcc36e8750e611e81 (patch) | |
tree | c24151220e32da4f9be511e2abdd578d270a21ee /src | |
parent | Merge pull request #1930 (diff) | |
download | monero-64377c90b5eef8bd3d19ae5dcc36e8750e611e81.tar.xz |
Add other possible paths of AC power status file on Linux
Diffstat (limited to 'src')
-rw-r--r-- | src/cryptonote_basic/miner.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/cryptonote_basic/miner.cpp b/src/cryptonote_basic/miner.cpp index 4c84e7eee..2f33f9e40 100644 --- a/src/cryptonote_basic/miner.cpp +++ b/src/cryptonote_basic/miner.cpp @@ -812,9 +812,11 @@ namespace cryptonote const std::string POWER_SUPPLY_STATUS_PATHS[] = { "/sys/class/power_supply/ACAD/online", - "/sys/class/power_supply/AC/online" + "/sys/class/power_supply/AC/online", + "/sys/class/power_supply/AC0/online", + "/sys/class/power_supply/ADP0/online" }; - + for(const std::string& path : POWER_SUPPLY_STATUS_PATHS) { if( epee::file_io_utils::is_file_exist(path) ) @@ -823,7 +825,7 @@ namespace cryptonote break; } } - + if( power_supply_path.empty() ) { LOG_ERROR("Couldn't find battery/power status file, can't determine if plugged in!"); |