Merge pull request #8769 from natinusala/master
platform_linux: more flexible battery display
This commit is contained in:
commit
59d8d701a6
|
@ -1101,10 +1101,14 @@ static bool frontend_unix_powerstate_check_acpi_sysfs(
|
||||||
retro_closedir(entry);
|
retro_closedir(entry);
|
||||||
|
|
||||||
entry = retro_opendir(proc_acpi_sysfs_ac_adapter_path);
|
entry = retro_opendir(proc_acpi_sysfs_ac_adapter_path);
|
||||||
if (!entry)
|
|
||||||
goto error;
|
|
||||||
|
|
||||||
check_proc_acpi_sysfs_ac_adapter(retro_dirent_get_name(entry), &have_ac);
|
if (entry)
|
||||||
|
{
|
||||||
|
check_proc_acpi_sysfs_ac_adapter(retro_dirent_get_name(entry), &have_ac);
|
||||||
|
retro_closedir(entry);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
have_ac = false;
|
||||||
|
|
||||||
if (!have_battery)
|
if (!have_battery)
|
||||||
{
|
{
|
||||||
|
@ -1117,8 +1121,6 @@ static bool frontend_unix_powerstate_check_acpi_sysfs(
|
||||||
else
|
else
|
||||||
*state = FRONTEND_POWERSTATE_ON_POWER_SOURCE;
|
*state = FRONTEND_POWERSTATE_ON_POWER_SOURCE;
|
||||||
|
|
||||||
retro_closedir(entry);
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
|
|
Loading…
Reference in New Issue