From 2a5c00e3a7a2c0046bf8a36e186e71a1e02e8011 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Fri, 16 May 2025 02:04:00 +0300 Subject: [PATCH] battery: skip writable check for power supply path It wouldn't even work, lol. --- src/battery.rs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/battery.rs b/src/battery.rs index 296096f..f393f25 100644 --- a/src/battery.rs +++ b/src/battery.rs @@ -87,13 +87,8 @@ pub fn set_battery_charge_thresholds(start_threshold: u8, stop_threshold: u8) -> )); } - // Check if the power supply directory is writable - // This helps identify permission issues in containerized environments early - if !is_path_writable(power_supply_path) { - return Err(ControlError::PermissionDenied( - "Power supply path exists but is not writable. This may occur in containerized environments.".to_string(), - )); - } + // XXX: Skip checking directory writability since /sys is a virtual filesystem + // Individual file writability will be checked by find_battery_with_threshold_support let supported_batteries = find_supported_batteries(power_supply_path)?; if supported_batteries.is_empty() {