From bfa858ff938db0053ed283a705999b95cd001332 Mon Sep 17 00:00:00 2001 From: ospab Date: Sun, 17 May 2026 01:30:00 +0300 Subject: [PATCH] fix: prevent premature Windows client shutdown due to empty/closed console event streams --- ostp-client/src/signal.rs | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/ostp-client/src/signal.rs b/ostp-client/src/signal.rs index b9a58aa..9b696ef 100644 --- a/ostp-client/src/signal.rs +++ b/ostp-client/src/signal.rs @@ -25,9 +25,21 @@ pub async fn wait_for_shutdown_signal() -> Result<()> { let mut c_break = ctrl_break()?; tokio::select! { - _ = c_c.recv() => {} - _ = c_close.recv() => {} - _ = c_break.recv() => {} + res = c_c.recv() => { + if res.is_none() { + std::future::pending::<()>().await; + } + } + res = c_close.recv() => { + if res.is_none() { + std::future::pending::<()>().await; + } + } + res = c_break.recv() => { + if res.is_none() { + std::future::pending::<()>().await; + } + } } } #[cfg(not(target_os = "windows"))]