summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
authorLibravatar sommerfeld <sommerfeld@sommerfeld.dev>2024-04-22 02:19:21 +0100
committerLibravatar sommerfeld <sommerfeld@sommerfeld.dev>2024-04-22 02:19:21 +0100
commit9a95d297678c4ba9e33f22c4e8e17173ce393878 (patch)
treedb594a01bbff21181c993f44a15c1216572a647b /src
parent6dfc3679cc73932eebc1fd84283fdc8b3bcc2c27 (diff)
downloadsentrum-9a95d297678c4ba9e33f22c4e8e17173ce393878.tar.gz
sentrum-9a95d297678c4ba9e33f22c4e8e17173ce393878.tar.bz2
sentrum-9a95d297678c4ba9e33f22c4e8e17173ce393878.zip
Add cfg(unix) to tokio::signal code
Diffstat (limited to 'src')
-rw-r--r--src/main.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs
index 9b10935..f4a7bde 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -11,6 +11,7 @@ use clap::Parser;
use human_panic::setup_panic;
use anyhow::{bail, Context, Result};
+#[cfg(unix)]
use tokio::signal::unix::{signal, SignalKind};
use tokio::time::sleep;
@@ -43,6 +44,7 @@ fn set_signal_handlers() -> Result<()> {
warn!("received ctrl-c signal. Exiting...");
exit(0)
});
+ #[cfg(unix)]
tokio::spawn(async move {
let mut stream = match signal(SignalKind::terminate()) {
Err(e) => return e,
@@ -52,6 +54,7 @@ fn set_signal_handlers() -> Result<()> {
warn!("received process termination signal. Exiting...");
exit(0)
});
+ #[cfg(unix)]
tokio::spawn(async move {
let mut stream = match signal(SignalKind::hangup()) {
Err(e) => return e,