mirror of
https://github.com/libretro/RetroArch
synced 2025-04-09 21:45:45 +00:00
(platform_linux.c) Cleanup
This commit is contained in:
parent
52f9084665
commit
9e309032d4
@ -787,18 +787,20 @@ static void check_proc_acpi_sysfs_battery(const char *node,
|
|||||||
if (filestream_read_file(path, (void**)&buf, &length) != 1)
|
if (filestream_read_file(path, (void**)&buf, &length) != 1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (buf && strstr((char*)buf, "Discharging"))
|
|
||||||
*have_battery = true;
|
|
||||||
else if (buf && strstr((char*)buf, "Charging"))
|
|
||||||
{
|
|
||||||
*have_battery = true;
|
|
||||||
*charging = true;
|
|
||||||
}
|
|
||||||
else if (buf && strstr((char*)buf, "Full"))
|
|
||||||
*have_battery = true;
|
|
||||||
|
|
||||||
if (buf)
|
if (buf)
|
||||||
|
{
|
||||||
|
if (strstr((char*)buf, "Discharging"))
|
||||||
|
*have_battery = true;
|
||||||
|
else if (strstr((char*)buf, "Charging"))
|
||||||
|
{
|
||||||
|
*have_battery = true;
|
||||||
|
*charging = true;
|
||||||
|
}
|
||||||
|
else if (strstr((char*)buf, "Full"))
|
||||||
|
*have_battery = true;
|
||||||
free(buf);
|
free(buf);
|
||||||
|
}
|
||||||
|
|
||||||
buf = NULL;
|
buf = NULL;
|
||||||
|
|
||||||
snprintf(path, sizeof(path), "%s/%s/%s", base, node, "capacity");
|
snprintf(path, sizeof(path), "%s/%s/%s", base, node, "capacity");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user