shared/util: assume ac when /sys/class/power_supply is missing

On s390 (at least) /sys/class/power_supply is not present. We should
treat this like if this directory was empty, and not an error.

(cherry picked from commit 6d89003462)
(cherry picked from commit 0436d5c5f4)
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2015-03-23 02:23:20 -04:00
parent 0a11be8375
commit b53c70c883
+1 -1
View File
@@ -5768,7 +5768,7 @@ int on_ac_power(void) {
d = opendir("/sys/class/power_supply");
if (!d)
return -errno;
return errno == ENOENT ? true : -errno;
for (;;) {
struct dirent *de;