| Index: net/dns/dns_config_service_posix.cc
|
| diff --git a/net/dns/dns_config_service_posix.cc b/net/dns/dns_config_service_posix.cc
|
| index 3385c52c3e479fe296cc3dcc897cd7e8f6c6fce8..f7833bce304fb073df73672fc36c9154732000c0 100644
|
| --- a/net/dns/dns_config_service_posix.cc
|
| +++ b/net/dns/dns_config_service_posix.cc
|
| @@ -30,24 +30,28 @@ class DnsConfigServicePosix::ConfigReader : public SerialWorker {
|
| success_(false) {}
|
|
|
| void DoWork() OVERRIDE {
|
| + success_ = false;
|
| +#if defined(OS_ANDROID)
|
| + NOTIMPLEMENTED();
|
| +#else
|
| #if defined(OS_OPENBSD)
|
| + // Note: res_ninit in glibc always returns 0 and sets RES_INIT.
|
| + // res_init behaves the same way.
|
| if ((res_init() == 0) && (_res.options & RES_INIT)) {
|
| success_ = ConvertResToConfig(_res, &dns_config_);
|
| + }
|
| #else
|
| struct __res_state res;
|
| if ((res_ninit(&res) == 0) && (res.options & RES_INIT)) {
|
| success_ = ConvertResToConfig(res, &dns_config_);
|
| -#endif
|
| - } else {
|
| - // Note: res_ninit in glibc always returns 0 and sets RES_INIT.
|
| - // res_init behaves the same way.
|
| - success_ = false;
|
| }
|
| +#endif
|
| #if defined(OS_MACOSX)
|
| res_ndestroy(&res);
|
| #elif !defined(OS_OPENBSD)
|
| res_nclose(&res);
|
| #endif
|
| +#endif // defined(OS_ANDROID)
|
| }
|
|
|
| void OnWorkFinished() OVERRIDE {
|
| @@ -84,6 +88,7 @@ DnsConfigService* DnsConfigService::CreateSystemService() {
|
| return new DnsConfigServicePosix();
|
| }
|
|
|
| +#if !defined(OS_ANDROID)
|
| bool ConvertResToConfig(const struct __res_state& res, DnsConfig* dns_config) {
|
| CHECK(dns_config != NULL);
|
| DCHECK(res.options & RES_INIT);
|
| @@ -136,5 +141,6 @@ bool ConvertResToConfig(const struct __res_state& res, DnsConfig* dns_config) {
|
|
|
| return true;
|
| }
|
| +#endif // !defined(OS_ANDROID)
|
|
|
| } // namespace net
|
|
|