ProtocolType::Dns exists only if feature local-dns enabled

- fixes #469
This commit is contained in:
zonyitoo
2021-03-26 19:59:34 +08:00
parent 7cd59966e3
commit ab7d19df64
2 changed files with 4 additions and 2 deletions

View File

@@ -306,7 +306,7 @@ fn main() {
}
}
#[cfg(target_os = "android")]
#[cfg(all(feature = "local-dns", target_os = "android"))]
if protocol != ProtocolType::Dns {
// Start a DNS local server binding to DNS_LOCAL_ADDR
//

View File

@@ -1,8 +1,10 @@
use std::io::{self, Error};
use std::io;
#[allow(dead_code)]
#[cfg(not(target_os = "android"))]
pub fn set_nofile(nofile: u64) -> io::Result<()> {
use std::io::Error;
unsafe {
// set both soft and hard limit
let lim = libc::rlimit {