From aea990946de936a075cd42458c2988372b952210 Mon Sep 17 00:00:00 2001 From: Johannes Leupolz Date: Fri, 17 Apr 2026 13:15:31 +0000 Subject: [PATCH] Notify all pending waiters on close --- vuinputd/src/cuse_device/state.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/vuinputd/src/cuse_device/state.rs b/vuinputd/src/cuse_device/state.rs index 3fd4870..d4ac899 100644 --- a/vuinputd/src/cuse_device/state.rs +++ b/vuinputd/src/cuse_device/state.rs @@ -137,6 +137,16 @@ impl PollState { } } +impl Drop for PollState { + fn drop(&mut self) { + //when the device closes, notify all pending waiters + let old_handle = self.take_waiters(); + if let Some(mut old_handle) = old_handle { + old_handle.notify(); + } + } +} + #[derive(Debug)] pub struct VuInputState { pub file: File,