Fix compilation on windows
Some checks failed
moparisthebest/xmpp-proxy/pipeline/head There was a failure building this commit

This commit is contained in:
Travis Burtrum 2023-08-17 23:46:34 -04:00
parent d34ab513e9
commit 2459576f52
2 changed files with 4 additions and 4 deletions

View File

@ -20,7 +20,7 @@ pub mod websocket;
#[cfg(any(feature = "s2s-incoming", feature = "outgoing"))] #[cfg(any(feature = "s2s-incoming", feature = "outgoing"))]
pub mod verify; pub mod verify;
#[cfg(feature = "nix")] #[cfg(all(feature = "nix", not(target_os = "windows")))]
pub mod systemd; pub mod systemd;
pub mod context; pub mod context;

View File

@ -1,7 +1,7 @@
#![deny(clippy::all)] #![deny(clippy::all)]
use anyhow::Result; use anyhow::Result;
use die::{die, Die}; use die::{die, Die};
use log::{debug, error, info}; use log::{debug, info};
use serde_derive::Deserialize; use serde_derive::Deserialize;
use std::{ use std::{
ffi::OsString, ffi::OsString,
@ -97,7 +97,7 @@ fn spawn_refresh_task(certs_key: &'static CertsKey, cfg_path: OsString) -> Optio
info!("reloaded cert/key successfully!"); info!("reloaded cert/key successfully!");
} }
} }
Err(e) => error!("invalid config/cert/key on SIGHUP: {}", e), Err(e) => log::error!("invalid config/cert/key on SIGHUP: {}", e),
}; };
} }
})) }))
@ -148,7 +148,7 @@ async fn main() {
outgoing_listen.push(TcpListener::bind(a).await.die("cannot listen on port/interface")); outgoing_listen.push(TcpListener::bind(a).await.die("cannot listen on port/interface"));
} }
#[cfg(feature = "nix")] #[cfg(all(feature = "nix", not(target_os = "windows")))]
if let Ok(fds) = xmpp_proxy::systemd::receive_descriptors_with_names(true) { if let Ok(fds) = xmpp_proxy::systemd::receive_descriptors_with_names(true) {
use xmpp_proxy::systemd::Listener; use xmpp_proxy::systemd::Listener;
for fd in fds { for fd in fds {