diff --git a/Cargo.toml b/Cargo.toml index 8fdf9ee..c7623ad 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -57,7 +57,7 @@ tokio = { version = "1.19.2", features = [ ] } toml = "0.5.9" -[target.'cfg(not(target_family = "windows"))'.dependencies] +[target.'cfg(target_family = "unix")'.dependencies] privdrop = "0.5.2" [dependencies.prometheus] diff --git a/src/main.rs b/src/main.rs index 5a8e758..d5d7796 100644 --- a/src/main.rs +++ b/src/main.rs @@ -62,7 +62,7 @@ use futures::prelude::*; use globals::*; use parking_lot::Mutex; use parking_lot::RwLock; -#[cfg(not(target_family = "windows"))] +#[cfg(target_family = "unix")] use privdrop::PrivDrop; use rand::prelude::*; use siphasher::sip128::SipHasher13; @@ -481,7 +481,7 @@ fn bind_listeners( Ok(sockets) } -#[cfg(not(target_family = "windows"))] +#[cfg(target_family = "unix")] fn privdrop(config: &Config) -> Result<(), Error> { let mut pd = PrivDrop::default(); if let Some(user) = &config.user { @@ -516,7 +516,7 @@ fn privdrop(config: &Config) -> Result<(), Error> { } #[cfg(not(target_family = "unix"))] -fn set_limits(config: &Config) -> Result<(), Error> { +fn set_limits(_config: &Config) -> Result<(), Error> { Ok(()) } @@ -604,7 +604,7 @@ fn main() -> Result<(), Error> { runtime_builder.thread_name("encrypted-dns-"); let runtime = runtime_builder.build()?; - #[cfg(not(target_family = "windows"))] + #[cfg(target_family = "unix")] privdrop(&config)?; let key_cache_capacity = config.dnscrypt.key_cache_capacity;