forked from lavina/lavina
fix for windows
This commit is contained in:
parent
c1a461a09e
commit
4b04696a4f
11
src/main.rs
11
src/main.rs
|
@ -67,6 +67,17 @@ async fn main() -> Result<()> {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(windows)]
|
||||||
|
fn ctrl_c() -> Result<impl Future<Output = ()>> {
|
||||||
|
use tokio::signal::windows::*;
|
||||||
|
let chan = ctrl_c()?;
|
||||||
|
async fn recv(mut chan: CtrlC) {
|
||||||
|
let _ = chan.recv().await;
|
||||||
|
}
|
||||||
|
Ok(recv(chan))
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(unix)]
|
||||||
fn ctrl_c() -> Result<impl Future<Output = ()>> {
|
fn ctrl_c() -> Result<impl Future<Output = ()>> {
|
||||||
use tokio::signal::unix::*;
|
use tokio::signal::unix::*;
|
||||||
let chan = signal(SignalKind::interrupt())?;
|
let chan = signal(SignalKind::interrupt())?;
|
||||||
|
|
Loading…
Reference in New Issue