From 8a39ee361feb9bf46d728ff1ba4f07ca1d9610b1 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Thu, 19 Jun 2014 09:22:53 +0200 Subject: Imported Upstream version 1.3 --- src/pkg/net/dnsconfig_unix.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/pkg/net/dnsconfig_unix.go') diff --git a/src/pkg/net/dnsconfig_unix.go b/src/pkg/net/dnsconfig_unix.go index 2f0f6c031..af288253e 100644 --- a/src/pkg/net/dnsconfig_unix.go +++ b/src/pkg/net/dnsconfig_unix.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build darwin dragonfly freebsd linux netbsd openbsd +// +build darwin dragonfly freebsd linux nacl netbsd openbsd solaris // Read system DNS config from /etc/resolv.conf @@ -20,14 +20,13 @@ type dnsConfig struct { // See resolv.conf(5) on a Linux machine. // TODO(rsc): Supposed to call uname() and chop the beginning // of the host name to get the default search domain. -// We assume it's in resolv.conf anyway. -func dnsReadConfig() (*dnsConfig, error) { - file, err := open("/etc/resolv.conf") +func dnsReadConfig(filename string) (*dnsConfig, error) { + file, err := open(filename) if err != nil { return nil, &DNSConfigError{err} } conf := new(dnsConfig) - conf.servers = make([]string, 3)[0:0] // small, but the standard limit + conf.servers = make([]string, 0, 3) // small, but the standard limit conf.search = make([]string, 0) conf.ndots = 1 conf.timeout = 5 -- cgit v1.2.3