提交 eac74786 编写于 作者: M maosiping

DNS解析时,无网络直接返回

Signed-off-by: Nmaosiping <maosiping@huawei.com>
上级 d98ab828
......@@ -173,7 +173,8 @@ static int name_from_dns_search(struct address buf[static MAXADDRS], char canon[
size_t l, dots;
char *p, *z;
if (__get_resolv_conf(&conf, search, sizeof search) < 0) return -1;
int res = __get_resolv_conf(&conf, search, sizeof search);
if (res < 0) return res;
/* Count dots, suppress search when >=ndots or name ends in
* a dot, which is an explicit request for global scope. */
......
......@@ -40,7 +40,7 @@ int __get_resolv_conf(struct resolvconf *conf, char *search, size_t search_sz)
dlclose(handle);
if (ret < 0) {
DNS_CONFIG_PRINT("__get_resolv_conf OHOS_GET_CONFIG_FUNC_NAME err %d\n", ret);
return -1;
return EAI_NONAME;
}
int32_t timeout_second = config.timeout_ms / 1000;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册