1
0
mirror of https://github.com/golang/go synced 2024-11-22 03:04:41 -07:00

time: Support Solaris zoneinfo directory.

R=rsc
CC=golang-dev
https://golang.org/cl/4079047
This commit is contained in:
Ian Lance Taylor 2011-01-28 15:56:14 -08:00
parent 504da53c85
commit 64c7f70c66

View File

@ -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
}