From 4f9a0a12e6b6311e7480f87d5bc45011d9a192ac Mon Sep 17 00:00:00 2001 From: Dominic Burkart Date: Tue, 20 Jun 2023 14:53:25 +0200 Subject: [PATCH] fix incorrect casts --- src/app.rs | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/src/app.rs b/src/app.rs index 6dca25555f3c7..248fbe78b905d 100644 --- a/src/app.rs +++ b/src/app.rs @@ -342,20 +342,42 @@ impl FinishedApplication { SignalTo::Shutdown => { emit!(VectorStopped); tokio::select! { - _ = topology_controller.stop() => ExitStatus::from_raw(exitcode::OK as u32), // Graceful shutdown finished + _ = topology_controller.stop() => ExitStatus::from_raw({ + #[cfg(windows)] + { + exitcode::OK as u32 + } + #[cfg(unix)] + exitcode::OK + }), // Graceful shutdown finished _ = signal_rx.recv() => { // It is highly unlikely that this event will exit from topology. emit!(VectorQuit); // Dropping the shutdown future will immediately shut the server down - ExitStatus::from_raw(exitcode::UNAVAILABLE as u32) + ExitStatus::from_raw({ + #[cfg(windows)] + { + exitcode::UNAVAILABLE as u32 + } + #[cfg(unix)] + exitcode::OK + }) } + } } SignalTo::Quit => { // It is highly unlikely that this event will exit from topology. emit!(VectorQuit); drop(topology_controller); - ExitStatus::from_raw(exitcode::UNAVAILABLE as u32) + ExitStatus::from_raw({ + #[cfg(windows)] + { + exitcode::UNAVAILABLE as u32 + } + #[cfg(unix)] + exitcode::OK + }) } _ => unreachable!(), }