From 2756bedc3d8ef2036bf80e700060bd1e69bbfa8c Mon Sep 17 00:00:00 2001 From: Aaron Housh Date: Mon, 2 Dec 2019 21:07:54 -0700 Subject: [PATCH] Fix for non Unix OS (#69) --- actix-rt/src/lib.rs | 1 + actix-server/src/signals.rs | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/actix-rt/src/lib.rs b/actix-rt/src/lib.rs index c56fe73c..d2dd13c0 100644 --- a/actix-rt/src/lib.rs +++ b/actix-rt/src/lib.rs @@ -53,6 +53,7 @@ pub mod net { pub use tokio::net::{UnixDatagram, UnixListener, UnixStream}; } + #[cfg(unix)] pub use self::unix::*; } diff --git a/actix-server/src/signals.rs b/actix-server/src/signals.rs index 6703d813..c001e237 100644 --- a/actix-server/src/signals.rs +++ b/actix-server/src/signals.rs @@ -11,12 +11,15 @@ use crate::server::Server; #[derive(PartialEq, Clone, Copy, Debug)] pub(crate) enum Signal { /// SIGHUP + #[cfg_attr(not(unix), allow(dead_code))] Hup, /// SIGINT Int, /// SIGTERM + #[cfg_attr(not(unix), allow(dead_code))] Term, /// SIGQUIT + #[cfg_attr(not(unix), allow(dead_code))] Quit, } @@ -69,7 +72,7 @@ impl Future for Signals { #[cfg(not(unix))] loop { match Pin::new(&mut self.stream).poll_next(cx) { - Poll::Ready(Ok(Some(_))) => self.srv.signal(Signal::Int), + Poll::Ready(Some(_)) => self.srv.signal(Signal::Int), Poll::Ready(None) => return Poll::Ready(()), Poll::Pending => return Poll::Pending, }