mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-07-13 19:29:53 +03:00
24 lines
1,020 B
Diff
24 lines
1,020 B
Diff
From 7f3fe72503087221485a98fb805caf93fcb6be21 Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?K=C3=A9vin=20Commaille?= <zecakeh@tedomum.fr>
|
|
Date: Mon, 5 May 2025 11:11:08 +0200
|
|
Subject: [PATCH] camera: Fix crash in LinuxCamera::has_cameras()
|
|
|
|
`timeout` needs to be called in an async block to make the future "lazy",
|
|
so that it is executed on the tokio runtime.
|
|
---
|
|
src/components/camera/linux/mod.rs | 2 +-
|
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
|
diff --git a/src/components/camera/linux/mod.rs b/src/components/camera/linux/mod.rs
|
|
index 22617a28..c8cca371 100644
|
|
--- a/src/components/camera/linux/mod.rs
|
|
+++ b/src/components/camera/linux/mod.rs
|
|
@@ -34,7 +34,7 @@ impl CameraExt for LinuxCamera {
|
|
}
|
|
}
|
|
};
|
|
- let handle = spawn_tokio!(timeout(Duration::from_secs(1), fut));
|
|
+ let handle = spawn_tokio!(async move { timeout(Duration::from_secs(1), fut).await });
|
|
|
|
if let Ok(is_present) = handle.await.expect("task was not aborted") {
|
|
is_present
|