Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Moved hardcoding of "/proc/apm" elsewhere.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Jun 30, 2009
1 parent 2bedbdf commit 7906195
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/power/linux/SDL_syspower.c
Expand Up @@ -34,6 +34,7 @@

#include "SDL_power.h"

static const char *proc_apm_path = "/proc/apm";
static const char *proc_acpi_battery_path = "/proc/acpi/battery";
static const char *proc_acpi_ac_adapter_path = "/proc/acpi/ac_adapter";

Expand Down Expand Up @@ -333,7 +334,7 @@ SDL_GetPowerInfo_Linux_proc_apm(SDL_PowerState * state,
int battery_flag = 0;
int battery_percent = 0;
int battery_time = 0;
const int fd = open("/proc/apm", O_RDONLY);
const int fd = open(proc_apm_path, O_RDONLY);
char buf[128];
char *ptr = &buf[0];
char *str = NULL;
Expand Down

0 comments on commit 7906195

Please sign in to comment.