aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2017-04-11 00:15:24 +0200
committerRiccardo Spagni <ric@spagni.net>2017-04-11 00:15:24 +0200
commit2037083b5f838ef904b6d6ec3ebaf350226721fe (patch)
treee0da4f23f916d9a8b993145ae71c6ca6d808c2d1 /src
parentMerge pull request #1932 (diff)
parentAdd other possible paths of AC power status file on Linux (diff)
downloadmonero-2037083b5f838ef904b6d6ec3ebaf350226721fe.tar.xz
Merge pull request #1937
64377c90 Add other possible paths of AC power status file on Linux (Guillaume LE VAILLANT)
Diffstat (limited to 'src')
-rw-r--r--src/cryptonote_basic/miner.cpp8
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!");