Improve privdrop condition

pull/88/head
YX Hao 2 years ago
parent 87e26a8aaa
commit 4f99570f22

@ -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]

@ -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 {
@ -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;

Loading…
Cancel
Save