aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2011-01-28 15:56:14 -0800
committerIan Lance Taylor <iant@golang.org>2011-01-28 15:56:14 -0800
commit64c7f70c66080aca3fc0b5550608e052eb28ca5d (patch)
tree084da8a8b3380d035006993f9133355c1d0022a2
parent504da53c858eb89fceaaa41f53db7e6a3e6c2f81 (diff)
downloadgo-64c7f70c66080aca3fc0b5550608e052eb28ca5d.tar.gz
go-64c7f70c66080aca3fc0b5550608e052eb28ca5d.zip
time: Support Solaris zoneinfo directory.
R=rsc CC=golang-dev https://golang.org/cl/4079047
-rw-r--r--src/pkg/time/zoneinfo_unix.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/pkg/time/zoneinfo_unix.go b/src/pkg/time/zoneinfo_unix.go
index 26c86ab038..6685da7477 100644
--- a/src/pkg/time/zoneinfo_unix.go
+++ b/src/pkg/time/zoneinfo_unix.go
@@ -18,6 +18,7 @@ import (
const (
headerSize = 4 + 16 + 4*7
zoneDir = "/usr/share/zoneinfo/"
+ zoneDir2 = "/usr/share/lib/zoneinfo/"
)
// Simple I/O interface to binary blob of data.
@@ -216,7 +217,11 @@ func setupZone() {
case err == os.ENOENV:
zones, _ = readinfofile("/etc/localtime")
case len(tz) > 0:
- zones, _ = readinfofile(zoneDir + tz)
+ var ok bool
+ zones, ok = readinfofile(zoneDir + tz)
+ if !ok {
+ zones, _ = readinfofile(zoneDir2 + tz)
+ }
case len(tz) == 0:
// do nothing: use UTC
}