summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: af5eb0c)
raw | patch | inline | side by side (parent: af5eb0c)
author | Peter Wu <peter@lekensteyn.nl> | |
Tue, 31 Mar 2015 21:17:32 +0000 (23:17 +0200) | ||
committer | Peter Wu <peter@lekensteyn.nl> | |
Tue, 31 Mar 2015 21:17:32 +0000 (23:17 +0200) |
Linux reports ENODEV if the reported battery values are equal to
ACPI_BATTERY_VALUE_UNKNOWN. This can be observed for an unpatched Clevo
B7130 laptop while reading the "Battery Present Charge" attribute.
Since this is a non-fatal, non-recoverable event, do not report such
errors. Also change the error message to report the filename triggering
this error to ease hunting down the error.
ACPI_BATTERY_VALUE_UNKNOWN. This can be observed for an unpatched Clevo
B7130 laptop while reading the "Battery Present Charge" attribute.
Since this is a non-fatal, non-recoverable event, do not report such
errors. Also change the error message to report the filename triggering
this error to ease hunting down the error.
src/battery.c | patch | blob | history |
diff --git a/src/battery.c b/src/battery.c
index f106da09bd4e2114cc82c2fb84de806a2db21960..9b060dd9286cc692f03cd8205121868fe0f786ae 100644 (file)
--- a/src/battery.c
+++ b/src/battery.c
if (fgets (buffer, buffer_size, fp) == NULL)
{
- char errbuf[1024];
status = errno;
- WARNING ("battery plugin: fgets failed: %s",
- sstrerror (status, errbuf, sizeof (errbuf)));
+ if (status != ENODEV)
+ {
+ char errbuf[1024];
+ WARNING ("battery plugin: fgets (%s) failed: %s", filename,
+ sstrerror (status, errbuf, sizeof (errbuf)));
+ }
fclose (fp);
return status;
}