1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-03 01:17:45 +03:00

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.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2015-03-03 19:07:28 -05:00
parent e93549ef29
commit 6d89003462

View File

@ -5999,7 +5999,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;