machine: ifdef chopping and splicing functions.

This stuff is bad...where did i learn to be doing such things.
This commit is contained in:
Alastair Poole 2020-07-11 18:34:49 +01:00
parent fe30a5a72f
commit 3ceaad0afd
1 changed files with 1 additions and 3 deletions

View File

@ -333,8 +333,6 @@ system_power_state_get(power_t *power)
#elif defined(__FreeBSD__) || defined(__DragonFly__)
unsigned int value;
size_t len;
#elif defined(__linux__)
char *buf;
#endif
if (!_power_battery_count_get(power))
@ -353,7 +351,7 @@ system_power_state_get(power_t *power)
power->have_ac = value;
#elif defined(__linux__)
buf = file_contents("/sys/class/power_supply/AC/online");
char *buf = file_contents("/sys/class/power_supply/AC/online");
if (buf)
{
power->have_ac = atoi(buf);