mirror of
https://github.com/clearlinux/systemd-stable.git
synced 2026-09-06 13:41:31 +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 commit6d89003462) (cherry picked from commit0436d5c5f4)
This commit is contained in:
+1
-1
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user