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

Unified Diff: net/dns/dns_config_service_posix.cc

Issue 8336024: OpenBSD patches for net, split from CR #8275005 (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: add missing crypto patch Created 9 years, 2 months 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
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 0224c39cb9ec0273a79f5b4d86efe7983f803776..89e447da1761b5d740464ad0c147c95dd239c779 100644
--- a/net/dns/dns_config_service_posix.cc
+++ b/net/dns/dns_config_service_posix.cc
@@ -30,16 +30,22 @@ class DnsConfigServicePosix::ConfigReader : public SerialWorker {
success_(false) {}
void DoWork() OVERRIDE {
+#if defined(OS_OPENBSD)
+ extern struct __res_state _res;
wtc 2011/10/18 21:50:26 Is the _res global variable not declared in any sy
Robert Nagy 2011/10/19 07:10:02 It is in resolv.h so I removed the declaration fro
+ 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.
success_ = false;
}
#if defined(OS_MACOSX)
res_ndestroy(&res);
-#else
+#elif !defined(OS_OPENBSD)
res_nclose(&res);
#endif
}
@@ -123,7 +129,9 @@ bool ConvertResToConfig(const struct __res_state& res, DnsConfig* dns_config) {
dns_config->ndots = res.ndots;
dns_config->timeout = base::TimeDelta::FromSeconds(res.retrans);
dns_config->attempts = res.retry;
+#if !defined(OS_OPENBSD)
dns_config->rotate = res.options & RES_ROTATE;
+#endif
wtc 2011/10/18 21:50:26 If RES_ROTATE is defined as a macro on all platfor
Robert Nagy 2011/10/19 07:10:02 Done.
dns_config->edns0 = res.options & RES_USE_EDNS0;
return true;

Powered by Google App Engine
This is Rietveld 408576698