Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1997)

Unified Diff: net/dns/dns_config_service_posix.cc

Issue 8429034: Upstream: Build net_unittests for Android. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: fix llog -- it's not for all targets Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/base/x509_certificate_openssl_android.cc ('k') | net/net.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..062e3bb21926c7b3ff54630f18355763012d645e 100644
--- a/net/dns/dns_config_service_posix.cc
+++ b/net/dns/dns_config_service_posix.cc
@@ -30,22 +30,22 @@ class DnsConfigServicePosix::ConfigReader : public SerialWorker {
success_(false) {}
void DoWork() OVERRIDE {
+ // Note: res_ninit in glibc always returns 0 and sets RES_INIT.
+ // res_init behaves the same way.
+ success_ = false;
joth 2011/11/03 19:45:02 I like this tidy up in terms of un-interleaving th
Jing Zhao 2011/11/04 08:01:43 Done.
#if defined(OS_OPENBSD)
if ((res_init() == 0) && (_res.options & RES_INIT)) {
success_ = ConvertResToConfig(_res, &dns_config_);
-#else
+ }
+#elif !defined(OS_ANDROID)
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)
+#elif !defined(OS_OPENBSD) && !defined(ANDROID)
res_nclose(&res);
#endif
}
@@ -84,6 +84,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 +137,6 @@ bool ConvertResToConfig(const struct __res_state& res, DnsConfig* dns_config) {
return true;
}
+#endif
} // namespace net
« no previous file with comments | « net/base/x509_certificate_openssl_android.cc ('k') | net/net.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698