From 87ef532ce418ef0d799dc441912b5edc3ed642f6 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Wed, 20 Mar 2024 18:19:33 -0700 Subject: [PATCH] manager: Move std::fs operations back into tokio::fs --- src/manager.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/manager.rs b/src/manager.rs index 57c6ae7..5cc3e08 100644 --- a/src/manager.rs +++ b/src/manager.rs @@ -407,10 +407,9 @@ impl SMManager { async fn get_als_integration_time_file_descriptor(&self) -> Result { // Get the file descriptor for the als integration time sysfs path - // Return -1 on error - let result = std::fs::File::create(ALS_INTEGRATION_PATH); + let result = File::create(ALS_INTEGRATION_PATH).await; match result { - Ok(f) => Ok(Fd::Owned(std::os::fd::OwnedFd::from(f))), + Ok(f) => Ok(Fd::Owned(std::os::fd::OwnedFd::from(f.into_std().await))), Err(message) => { error!("Error opening sysfs file for giving file descriptor: {message}"); Err(zbus::fdo::Error::IOError(message.to_string()))