mirror of
https://codeberg.org/anoncontributorxmr/monero.git
synced 2024-11-23 18:47:36 -07:00
Merge pull request #1937
64377c90
Add other possible paths of AC power status file on Linux (Guillaume LE VAILLANT)
This commit is contained in:
commit
2037083b5f
@ -812,9 +812,11 @@ namespace cryptonote
|
|||||||
const std::string POWER_SUPPLY_STATUS_PATHS[] =
|
const std::string POWER_SUPPLY_STATUS_PATHS[] =
|
||||||
{
|
{
|
||||||
"/sys/class/power_supply/ACAD/online",
|
"/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)
|
for(const std::string& path : POWER_SUPPLY_STATUS_PATHS)
|
||||||
{
|
{
|
||||||
if( epee::file_io_utils::is_file_exist(path) )
|
if( epee::file_io_utils::is_file_exist(path) )
|
||||||
@ -823,7 +825,7 @@ namespace cryptonote
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( power_supply_path.empty() )
|
if( power_supply_path.empty() )
|
||||||
{
|
{
|
||||||
LOG_ERROR("Couldn't find battery/power status file, can't determine if plugged in!");
|
LOG_ERROR("Couldn't find battery/power status file, can't determine if plugged in!");
|
||||||
|
Loading…
Reference in New Issue
Block a user