diff options
Diffstat (limited to 'libgo/go/time/zoneinfo_unix.go')
-rw-r--r-- | libgo/go/time/zoneinfo_unix.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libgo/go/time/zoneinfo_unix.go b/libgo/go/time/zoneinfo_unix.go index 3fe8e55795c..5fc669e478d 100644 --- a/libgo/go/time/zoneinfo_unix.go +++ b/libgo/go/time/zoneinfo_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 nacl netbsd openbsd solaris +// +build darwin,386 darwin,amd64 dragonfly freebsd linux nacl netbsd openbsd solaris // Parse "zoneinfo" time zone file. // This is a fairly standard file format used on OS X, Linux, BSD, Sun, and others. @@ -70,11 +70,17 @@ func initLocal() { } func loadLocation(name string) (*Location, error) { + var firstErr error for _, zoneDir := range zoneDirs { if z, err := loadZoneFile(zoneDir, name); err == nil { z.name = name return z, nil + } else if firstErr == nil && !isNotExist(err) { + firstErr = err } } + if firstErr != nil { + return nil, firstErr + } return nil, errors.New("unknown time zone " + name) } |