manager: Move std::fs operations back into tokio::fs

This commit is contained in:
Vicki Pfau 2024-03-20 18:19:33 -07:00
parent f8d390d6ff
commit 87ef532ce4

View file

@ -407,10 +407,9 @@ impl SMManager {
async fn get_als_integration_time_file_descriptor(&self) -> Result<Fd, zbus::fdo::Error> { async fn get_als_integration_time_file_descriptor(&self) -> Result<Fd, zbus::fdo::Error> {
// Get the file descriptor for the als integration time sysfs path // Get the file descriptor for the als integration time sysfs path
// Return -1 on error let result = File::create(ALS_INTEGRATION_PATH).await;
let result = std::fs::File::create(ALS_INTEGRATION_PATH);
match result { 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) => { Err(message) => {
error!("Error opening sysfs file for giving file descriptor: {message}"); error!("Error opening sysfs file for giving file descriptor: {message}");
Err(zbus::fdo::Error::IOError(message.to_string())) Err(zbus::fdo::Error::IOError(message.to_string()))