Alexandre Julliard (@julliard) commented about dlls/ntdll/unix/system.c:
- bs->AcOnLine = get_sys_int("/sys/class/power_supply/AC/online", 1);
- bs->AcOnLine = TRUE;
- if (!d) return STATUS_SUCCESS;
- for (;;)
- while ((de = readdir(d))) {
sprintf(path, "/sys/class/power_supply/BAT%u/status", i);
if (!get_sys_str(path, s)) break;
bs->Charging |= (strcmp(s, "Charging\n") == 0);
bs->Discharging |= (strcmp(s, "Discharging\n") == 0);
bs->BatteryPresent = TRUE;
i++;
- }
if (strcmp(de->d_name, ".") == 0 || strcmp(de->d_name, "..") == 0) continue;
if (snprintf(path, sizeof(path), "/sys/class/power_supply/%s", de->d_name) < 0) continue;
Same here.