diff --git a/local/recipes/system/redbear-upower/source/src/main.rs b/local/recipes/system/redbear-upower/source/src/main.rs index 28b9813fab..7b612997f3 100644 --- a/local/recipes/system/redbear-upower/source/src/main.rs +++ b/local/recipes/system/redbear-upower/source/src/main.rs @@ -211,7 +211,9 @@ impl PowerRuntime { } fn available(&self) -> bool { - self.root.exists() + // is_dir() uses stat which misbehaves on Redox schemes; read_dir + // is the only reliable existence probe. + self.root.read_dir().is_ok() } fn adapter_dir(&self, id: &str) -> PathBuf { diff --git a/local/recipes/system/thermald/source/src/main.rs b/local/recipes/system/thermald/source/src/main.rs index 7a38249872..0b9791175f 100644 --- a/local/recipes/system/thermald/source/src/main.rs +++ b/local/recipes/system/thermald/source/src/main.rs @@ -534,7 +534,10 @@ fn monitor_loop(shared: Arc>) -> ! { let mut warned_missing_surface = false; loop { - if !Path::new(ACPI_THERMAL_ROOT).exists() { + // is_dir() / exists() use stat/lstat which return errors on + // Redox schemes; read_dir is the only reliable existence probe. + let surface_available = fs::read_dir(ACPI_THERMAL_ROOT).is_ok(); + if !surface_available { if !warned_missing_surface { warn!( "{} is unavailable; thermald will keep polling and serve an empty thermal surface",