From ab7d19df64c9971e5f8a02fd8817c1b9b184c212 Mon Sep 17 00:00:00 2001 From: zonyitoo Date: Fri, 26 Mar 2021 19:59:34 +0800 Subject: [PATCH] ProtocolType::Dns exists only if feature local-dns enabled - fixes #469 --- bin/sslocal.rs | 2 +- crates/shadowsocks-service/src/sys/unix/mod.rs | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/bin/sslocal.rs b/bin/sslocal.rs index 5e5e7a4d..9d03120e 100644 --- a/bin/sslocal.rs +++ b/bin/sslocal.rs @@ -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 // diff --git a/crates/shadowsocks-service/src/sys/unix/mod.rs b/crates/shadowsocks-service/src/sys/unix/mod.rs index 5cb80698..2c85aeb8 100644 --- a/crates/shadowsocks-service/src/sys/unix/mod.rs +++ b/crates/shadowsocks-service/src/sys/unix/mod.rs @@ -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 {