acpid: handle getdents on empty Thermal and Power dirs
thermald and redbear-upower read_dir /scheme/acpi/{thermal,power} to
enumerate ACPI _TZ zones and _PR power sources. The acpid scheme
returned EIO for these new directory variants, which std::fs::read_dir
interprets as 'the path is not a directory or doesn't exist' and
emits a warning.
Return Ok with no entries for Thermal/Power getdents so read_dir
sees an existing-but-empty directory and consumers gracefully fall
through to the empty-state path.
This commit is contained in:
@@ -407,6 +407,13 @@ impl SchemeSync for AcpiScheme<'_, '_> {
|
||||
})?;
|
||||
}
|
||||
}
|
||||
HandleKind::Thermal | HandleKind::Power => {
|
||||
// Empty placeholder directories. Consumers (thermald,
|
||||
// redbear-upower) iterate them with read_dir and gracefully
|
||||
// handle the empty result. Returning Ok with no entries
|
||||
// is what `read_dir` expects for an existing-but-empty
|
||||
// directory.
|
||||
}
|
||||
_ => return Err(Error::new(EIO)),
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user