Package: brightd
Version: 0.4.1-1
Severity: important
Tags: patch
Dear Maintainer,
the program uses the old /proc/acpi/ac_adapter/AC/state to determine if
the system is on AC. Included you'll find a patch to use
/sys/class/power_supply/AC/online for this functionality.
Moritz
-- System Information:
Debian Release: jessie/sid
APT prefers testing
APT policy: (500, 'testing'), (1, 'experimental'), (1, 'unstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 3.14-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages brightd depends on:
ii libc6 2.19-4
ii libx11-6 2:1.6.2-2
ii libxss1 1:1.2.2-1
brightd recommends no packages.
brightd suggests no packages.
-- Configuration Files:
/etc/default/brightd changed [not included]
-- no debconf information
--- a/brightd.c
+++ b/brightd.c
@@ -183,16 +183,16 @@
*/
int isOnAC() /*{{{*/
{
- char line[255];
- FILE *ac = fopen("/proc/acpi/ac_adapter/AC/state", "r");
+ int ac_state;
+ FILE *ac = fopen("/sys/class/power_supply/AC/online", "r");
if(!ac) {
/* Ignore this */
return 0;
}
- fgets(line, 255, ac);
+ ac_state = fgetc(ac);
fclose(ac);
- return strstr(line, "on-line") != NULL;
+ return ac_state;
} /*}}}*/
/*