Beispiel #1
0
static void
cb_timer(void *data)
{
   struct stat         st;

   if ((stat("/proc/apm", &st) > -1) && S_ISREG(st.st_mode))
      cb_timer_apm(data);
   else if ((stat("/proc/acpi", &st) > -1) && S_ISDIR(st.st_mode))
      cb_timer_acpi(data);
}
Beispiel #2
0
static void
cb_timer(void *data)
{
   struct stat         st;

   if ((stat("/proc/apm", &st) > -1) && S_ISREG(st.st_mode))
      cb_timer_apm(data);
   else if ((stat("/proc/acpi/battery", &st) > -1) && S_ISDIR(st.st_mode))
      cb_timer_acpi(data);
   else if ((stat("/sys/class/power_supply", &st) > -1) && S_ISDIR(st.st_mode))
      cb_timer_sys(data);
}