mirror of
https://github.com/clearlinux/systemd-stable.git
synced 2026-09-06 21:51:37 +00: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.
(cherry picked from commit 6d89003462)
This commit is contained in:
+1
-1
@@ -5994,7 +5994,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;
|
||||
|
||||
Reference in New Issue
Block a user